Sunday, December 21, 2008

Control "CONTROL_NAME" or type "CONTROL_TYPE" must be placed inside a form tag with runat=server

today morning i was migrating an Arcgis server application from 9.2 to 9.3 where i had some custom made tools in the toolbar, one of the tools is rebinding a gridview control and refreshing it. but i was getting a strange following message Control "FPLegend_CGresults" or type "Gridview" must be placed inside a form tag with runat=server.



the first moment i thought that esri changed the way we do callbacks but google a bit i found out the solution but im not convinced with the error since i have my control within a form tag with runat=server.

still invistigating into it but here is how you can fix the problem:

in you default.aspx <@ page..> add the following attribute EnableEventValidation="false"

in your default.aspx.cs override the following VerifyRenderingInServerForm() function like this

public override void VerifyRenderingInServerForm(Control control)
{
//base.VerifyRenderingInServerForm(control);
//
}


hope this helps others

2 comments:

Pragnesh Patel said...

Thank a lot!!
I was having same problem.
& it solved.......

Anonymous said...

Can anyone recommend the well-priced Script Deployment software for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central system network
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!