using "&" in a Textbox
-
Hello everyone, Have a textbox.. when you enter & and display the result.. it works fine.. but using viewstat it actually has & for it.. so when I save it in the database.. the character & is saved rather than just "&".. can't believe i searched for an hour and couldn't find help for this simple issue :s.. any help would b highly appreciated.. Thanks Ali
-
Hello everyone, Have a textbox.. when you enter & and display the result.. it works fine.. but using viewstat it actually has & for it.. so when I save it in the database.. the character & is saved rather than just "&".. can't believe i searched for an hour and couldn't find help for this simple issue :s.. any help would b highly appreciated.. Thanks Ali
Ok, I'm not sure I understood the problem. I'm guessing your characters were getting converted. So, you type in the ampersand character ("&") and after post-back, the value is changed to "&". Is that correct? If so, I haven't seen that happen before. I would suggest debugging/tracing the post-back to see what's going on. Are you using a regular
<asp:TextBox />
? Michael Flanakin Web Log -
Ok, I'm not sure I understood the problem. I'm guessing your characters were getting converted. So, you type in the ampersand character ("&") and after post-back, the value is changed to "&". Is that correct? If so, I haven't seen that happen before. I would suggest debugging/tracing the post-back to see what's going on. Are you using a regular
<asp:TextBox />
? Michael Flanakin Web LogThanks for the reply Michael.. thats exactly what i was asking for.. i got the solution.. wasn't my code.. whoever wrote it.. used Server.HtmlEncode(TextBox1.Text).. thats y & was convert to amp.. anyways.. thanks again :) Ali
-
Thanks for the reply Michael.. thats exactly what i was asking for.. i got the solution.. wasn't my code.. whoever wrote it.. used Server.HtmlEncode(TextBox1.Text).. thats y & was convert to amp.. anyways.. thanks again :) Ali
Glad you found the problem. I thought that was a pretty odd problem. That explains it, tho. Michael Flanakin Web Log