C# code
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
RadGrid1.RenderControl(htw);
RenderControl throws the following exception -
"Control 'RadGrid1_ctl00_ctl02_ctl00_AddNewRecordButton' of type 'Button' must be placed inside a form tag with runat=server."
ASPX code
<form>
<div>
<table>
<td>
<telerik:RadGrid ID="RadGrid1" Skin="WebBlue" runat="server" AllowPaging="True"PageSize="10" AllowSorting="True" Width="950px" AutoGenerateColumns="False" ShowStatusBar="true"HorizontalAlign="NotSet" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand" BorderStyle="Ridge" OnPreRender="RadGrid1_PreRender">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView CommandItemDisplay="Top" DataKeyNames="TestID" Width="950px" runat="server">
<Columns>some columns</Columns>
</MasterTableView>
</tererik:RadGrid>
</td>
</table>
</div>
</form>
Using version - RadControls for ASP.NET AJAX
Any thoughts/suggestions?
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
RadGrid1.RenderControl(htw);
RenderControl throws the following exception -
"Control 'RadGrid1_ctl00_ctl02_ctl00_AddNewRecordButton' of type 'Button' must be placed inside a form tag with runat=server."
ASPX code
<form>
<div>
<table>
<td>
<telerik:RadGrid ID="RadGrid1" Skin="WebBlue" runat="server" AllowPaging="True"PageSize="10" AllowSorting="True" Width="950px" AutoGenerateColumns="False" ShowStatusBar="true"HorizontalAlign="NotSet" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand" BorderStyle="Ridge" OnPreRender="RadGrid1_PreRender">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView CommandItemDisplay="Top" DataKeyNames="TestID" Width="950px" runat="server">
<Columns>some columns</Columns>
</MasterTableView>
</tererik:RadGrid>
</td>
</table>
</div>
</form>
Using version - RadControls for ASP.NET AJAX
Any thoughts/suggestions?
