Connecting Tech Pros Worldwide Forums | Help | Site Map

ValidateInput - Compilation Error

Patrick Huffer
Guest
 
Posts: n/a
#1: Nov 18 '05
When I open a certain page, I receive a "Compilation Error" as
follows:

Compiler Error Message: CS0117: 'System.Web.UI.HtmlControls.HtmlForm'
does not
contain a definition for 'ValidateInput'
Source Error:
Line 712: this.EnableViewStateMac = true;
Line 713: this.SmartNavigation = true;
Line 714: this.Request.ValidateInput();
Line 715: }
Line 716:
Source File: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry
ASP.NET
Files\twrgrp_apps_inspectionsv2\0eeca9c5\cb7e36a7\ 5uspnrgt.0.cs
Line: 714

This file is autogenerated by ASP.NET - I have no control over it. I
looked up "ValidateInput()" - the documentation says it is only in
version 1.1 of the framework. My application was originally desinged
in 1.0 of the framework - maybe that has something to do with it?
Visual Studio converted it to 1.1 for me when I upgraded. Also, the
web form has a couple embedded user controls - if that affects
anything.

Just looking at this code - it's clearly asking for
REQUEST.ValidateInput() - why does it complain that there is no
HTMLFORM.ValidateInput()? Does anybody have any idea what's going on
here??

Victor Garcia Aprea [MVP]
Guest
 
Posts: n/a
#2: Nov 18 '05

re: ValidateInput - Compilation Error


Hi Patrick,

That sounds weird. I've looked at this feature extensively[1] and by your
posted code it looks like the parser-generated class is just plain wrong. It
would really help if you could post a very little sample to repro the issue.

[1] http://weblogs.asp.net/vga/archive/2003/05/02/6329.aspx

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

Patrick Huffer" <patrickhuffer@hotmail.com> wrote in message
news:c9116053.0401221439.42b81018@posting.google.c om...[color=blue]
> When I open a certain page, I receive a "Compilation Error" as
> follows:
>
> Compiler Error Message: CS0117: 'System.Web.UI.HtmlControls.HtmlForm'
> does not
> contain a definition for 'ValidateInput'
> Source Error:
> Line 712: this.EnableViewStateMac = true;
> Line 713: this.SmartNavigation = true;
> Line 714: this.Request.ValidateInput();
> Line 715: }
> Line 716:
> Source File: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry
> ASP.NET
> Files\twrgrp_apps_inspectionsv2\0eeca9c5\cb7e36a7\ 5uspnrgt.0.cs
> Line: 714
>
> This file is autogenerated by ASP.NET - I have no control over it. I
> looked up "ValidateInput()" - the documentation says it is only in
> version 1.1 of the framework. My application was originally desinged
> in 1.0 of the framework - maybe that has something to do with it?
> Visual Studio converted it to 1.1 for me when I upgraded. Also, the
> web form has a couple embedded user controls - if that affects
> anything.
>
> Just looking at this code - it's clearly asking for
> REQUEST.ValidateInput() - why does it complain that there is no
> HTMLFORM.ValidateInput()? Does anybody have any idea what's going on
> here??[/color]


Patrick Huffer
Guest
 
Posts: n/a
#3: Nov 18 '05

re: ValidateInput - Compilation Error


"Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message news:<eaHIAEU4DHA.1596@TK2MSFTNGP10.phx.gbl>...[color=blue]
> Hi Patrick,
>
> That sounds weird. I've looked at this feature extensively[1] and by your
> posted code it looks like the parser-generated class is just plain wrong. It
> would really help if you could post a very little sample to repro the issue.[/color]

Hi Victor -

Thanks for your reply. I found the cause of the problem - the
reference to "HtmlForm" made me think of the web page's <form> tag -
and it turns out that somehow that tag was given the id "Request". I
don't name my <form>'s - I always suspected that Visual Studio
generates a name for you based on the name of your file - but in this
case the file was called "Results.aspx", so I don't know how it
happened. Anyway I removed the "id=Request" from the <form> tag (and I
also removed "method=post"), and the problem went away. It seems that
somehow the HtmlForm (which is what your <form> tag becomes, right?)
was interpreted as a Request object because it was named "Request"?
Very interesting!
Closed Thread