Showing posts with label must be placed inside a form tag with runat=server. Show all posts
Showing posts with label must be placed inside a form tag with runat=server. Show all posts

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