Thursday, March 13, 2014

Control 'gv' of type 'GridView' must be placed inside a form tag with runat=server.



I have gotten this error several times:

Control 'gv' of type 'GridView' must be placed inside a form tag with runat=server.

Each time I forget the solution and after I fix it I eventually forget why I was getting it.  This time is not different.  I can't remember why it started happening, but the solution is to create a method like this.

public override void VerifyRenderingInServerForm(Control control)

{
 
/* Verifies that the control is rendered */
}

No comments: