|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using Control.Render() from a page with a MasterPageSystem.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter(sw); // this throws the exception gridResults.RenderControl(htw); I am using a ContentPlaceHolder and the form is on the MasterPage. I get the following error message... System.Web.HttpException was unhandled by user code Message="Control 'ctl00_ContentPlaceHolder1_gridResults' of type 'GridView' must be placed inside a form tag with runat=server." Source="System.Web" ErrorCode=-2147467259 StackTrace: at System.Web.UI.Page.VerifyRenderingInServerForm(Control control) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer, Boolean renderPanel) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ExportData.ExportToExcel() in c:\Work\SAGEAnalyzerGUI_2\App_Code\ExportData.cs:line 115 at ExportData.Export() in c:\Work\SAGEAnalyzerGUI_2\App_Code\ExportData.cs:line 100 at PageMaster.ExportToExcel() in c:\Work\SAGEAnalyzerGUI_2\PageMaster.master.cs:line 32 at FuelBurnResults.BtnExportExcelClick(Object sender, EventArgs e) in ..... Is there a way to call the Render() method and still use a MasterPage? Thanks. David
how to do this?
error: can't find control 'mylabel' data inserted again after refresh strange problem with EditItemTemplate Create popup after server side validation possible sqldatasource bug GridView - Pager Disappears Gridview problem how to call an asp page from an email Validator element rendered to page as enabled=false |
|||||||||||||||||||||||