PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET HTML code in textbox then string

Reply

HTML code in textbox then string

 
Thread Tools Rate Thread
Old 14-03-2006, 06:48 PM   #1
gn@dana.ucc.nau.edu
Guest
 
Posts: n/a
Default HTML code in textbox then string


I have a simple app that asks a user to enter text in a multiline
textbox, (runat server) then submit, after submitting this text is then
assigned to a variable as a string.
This works fine with regular text like: This is a test
However if I try to enter HTML code in the textbox, the submit onclick
event doesn't even fire.
It doesn't have to be complex HTML code, even: <div align="left"> will
cause it to fail, changing it to: div align="left" makes it work fine,
so <> seem to be the problem
Why is this and is there anyway to avoid this without removing them
because I will need the HTML code in tact later

Thanks in advance

  Reply With Quote
Old 15-03-2006, 04:43 AM   #2
James Jardine
Guest
 
Posts: n/a
Default Re: HTML code in textbox then string


<gn@dana.ucc.nau.edu> wrote in message
news:1142362082.833483.264500@u72g2000cwu.googlegroups.com...
>I have a simple app that asks a user to enter text in a multiline
> textbox, (runat server) then submit, after submitting this text is then
> assigned to a variable as a string.
> This works fine with regular text like: This is a test
> However if I try to enter HTML code in the textbox, the submit onclick
> event doesn't even fire.
> It doesn't have to be complex HTML code, even: <div align="left"> will
> cause it to fail, changing it to: div align="left" makes it work fine,
> so <> seem to be the problem
> Why is this and is there anyway to avoid this without removing them
> because I will need the HTML code in tact later
>
> Thanks in advance
>


You might want to check into ValidateRequest . This will cause an error to
be thrown if you try to pass html tags back to the iis server. I am not
sure why your page does nothing. If ValidateRequest is true (default) then
it should throw an error on the page. What version of asp.net are you
using? 2005 or 2003. 2005 might have added a property for the client to
check for these characters. I have a web form in 2005 that allows for html
input but I had to set validateRequrest = false in the page directive.
Good Luck

jjardine


  Reply With Quote
Old 21-03-2006, 10:00 PM   #3
AZNewsh
Guest
 
Posts: n/a
Default Re: HTML code in textbox then string

Thanks, that is the problem

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off