I'm in a bit of a pickle. I'm dealing with a web portal that uses a
single aspx file at the top, which dynamically loads ascx controls
into it. On one of these controls I have a textbox that I'd like to
enter html codes into.
Problem-- every time I try submitting the page I get the warning
message that I may be posting unsafe data. I'd like to set things so
there is no validation from the ascx file. I cannot set the
pageValidate attribute, because it's an ascx file I'm dealing with and
I don't want to set that for what amounts to the entire portal.
I'm using .Net 1.1. Is there a way to at least htmlencode my textbox
before the page is submitted? I can't find a way around my quandry,
and any help is appreciated!
Michael Nemtsev [MVP] - 15 Dec 2007 07:00 GMT
Hello howboutafresca@gmail.com,
could you post the exact error u get?
I suppose it's because your html, which u are trying to insert is not encoded.
I'd try to use HttpUtility.HtmlEncode to encode insterted text
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
> I'm in a bit of a pickle. I'm dealing with a web portal that uses a
> single aspx file at the top, which dynamically loads ascx controls
[quoted text clipped - 10 lines]
> before the page is submitted? I can't find a way around my quandry,
> and any help is appreciated!