Author: chafikb | Posted on: 11/21/2006 10:43:04 PM | Views : 349

Greetings, I have the following code that runs the last thing in the Page_Load event.

--------------------------------
Dim SB As New StringBuilder()
Dim SW As New StringWriter(SB)
Dim htmlTW As New HtmlTextWriter(SW)
GridView1.RenderControl(htmlTW) ' Im doing all this so I can clean the html output from the grid view to fit the strict html/css rules of my page and insert it back.
-------------------------------
for some reason, on the last line, I'm getting this error
Control 'ctl00_ControlPlaceHoder_GridView1' of type 'GridView' must be placed inside a form tag with runat=server.

my form has a runat="server" attribute and I know that the gridview has produced all the needed rows and information I need because I'm able to run ?gridview1.Rows.Count in my immediate window and get the number of rows. If I do the same code above o ...

Go to the complete details ...