Email Address error in form submit [Resolved]

Posted by Jopito under ASP.NET on 11/21/2013 | Points: 10 | Views : 5102 | Status : [Member] | Replies : 14
After submitting data in database,the records are added succesfully but the textbox for the the user address does not pick the entered email.It returns error
"The specified string is not in the form required for an e-mail address."
here is the textbox
"message.To.Add(ContactpersonEmailAddress.Text);"
previously it would send to the entered email bt now am not able to.Thanks

Mark as answer if satisfied


Responses

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
check this
http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
try this...
message.To.Add(ContactpersonEmailAddress.Text.Replace(",", "");


or

message.To.Add(ContactpersonEmailAddress.Text.Replace(";", "");



Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Is there any Validation controls on Email text box?

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Is there any invalid character in your textbox?
please check that one.

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
Yeah.i have the required field control,av not used the email validator

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
can you post <asp:TextBox ... > related code along with validators......
And also the email address which you attempted to enter

Is there any RegularExpressionValidator on Email ?

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
I have entered a valid email but still show s the error "The specified string is not in the form required for an e-mail address."

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
here is the textbox
<td>
<telerik:RadTextBox ID="emailAddressRadtextbox" Runat="server" MaxLength="30">
</telerik:RadTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Invalid Email" ControlToValidate="emailAddressRadtextbox">*</asp:RequiredFieldValidator>
</td>

I tried to enter this email (gracekahuhia@yahoo.com)witout the brackets

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
refer
http://forums.asp.net/t/1595328.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
It brings the same error after changing this.textboxmail.text

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi have you used regular expression validator for email validation. if yes then check the validation expression.
if you have given wrong validation expression, thatswhy message object is not taking valid email. check this also.

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks very much Chandu,av used ya code and its solved.I replaced the textbox and added a new one again.So helpful people you are .Thank you all

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Welcome....

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jopito on: 11/21/2013 [Member] Starter | Points: 25

Up
0
Down
I added another textbox for it where i added the email to send from my original one whioch would submit to the database,after changing that,i did not pass the value entered into the textbox to the database as i have one which will pick that data...to me this has worked and have checked the email and found it.Thanks

Mark as answer if satisfied

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response