Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Xml web control and request validation error

Reply
Thread Tools

Xml web control and request validation error

 
 
Aamir Ghanchi
Guest
Posts: n/a
 
      03-20-2008
Hi,

I hope there is a solution for this other than lowering guard by
turning off ValidateRequest property of the page (or in webconfig)

On page load I move xml string value into an Xml web control's
DocumentContent property (not the XmlDataSource) and enableviewstate
to true. When the page posts back, I get the error as follows:

"A potentially dangerous Request.Form value was detected from the
client ..."

It's obviously freaking out on the angled brackets in the content.
Being an asp control I thought it should be given a special treatment
by asp through some internal encodeing etc. I tried HtmlEncode, but it
will throw some other xml exception of being not well formed or
msissing root. Any way I gave up and am using a HiddenField instead to
hold the value between the trips, but it would be nice to use xml
control to hold xml data.

Any ideas?

TIA


 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      03-20-2008
Well, as you've discovered, you don't have to use an Xml Control. In fact,
you don't need any control at all to "hold" the Xml string - you could store
it in Session state.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Aamir Ghanchi" wrote:

> Hi,
>
> I hope there is a solution for this other than lowering guard by
> turning off ValidateRequest property of the page (or in webconfig)
>
> On page load I move xml string value into an Xml web control's
> DocumentContent property (not the XmlDataSource) and enableviewstate
> to true. When the page posts back, I get the error as follows:
>
> "A potentially dangerous Request.Form value was detected from the
> client ..."
>
> It's obviously freaking out on the angled brackets in the content.
> Being an asp control I thought it should be given a special treatment
> by asp through some internal encodeing etc. I tried HtmlEncode, but it
> will throw some other xml exception of being not well formed or
> msissing root. Any way I gave up and am using a HiddenField instead to
> hold the value between the trips, but it would be nice to use xml
> control to hold xml data.
>
> Any ideas?
>
> TIA
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error XML validation JAXP:org.xml.sax.SAXParseException KaR Java 1 10-09-2008 12:32 PM
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Dhruba Bandopadhyay ASP .Net 1 05-25-2006 01:06 AM
XML schema validation of one xml block based on values from another xml block Andy XML 0 11-18-2004 11:04 PM
Displaying a Validation Error in a Validation Summary Control Lucas Tam ASP .Net 2 02-26-2004 07:49 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM



Advertisments