プログラムで生成された折りたたみ可能なパネルエクステンダーを、パネルなどとともにjavascriptを使用して返すことができるようにしたいと考えています。私はパネルを持っているし、関連テーブルがうまくいっていますが、私が試して接続すると、それは壊れます。そして、エラーが返されます。ajax/javascriptを介してCollapsiblePanelExtenderを返す
CPEパネルを、そのようなは、Webサービスによってgeneragedされていると私はJSのWebサービスは、特定のフィールドを動的
Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'Sub_Menu_Helper' failed with the following error: System.InvalidOperationException-- Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
{
Label somelabel = new Label();
somelabel.ID = somenumber.ToString();
somelabel.Text = somenumber.ToString();
subpnlContent.Controls.Add(somelabel);
++somenumber;
}
CollapsiblePanelExtender cpeMenuLast = new CollapsiblePanelExtenderEx();
cpeMenuLast.ID = "subcpe" + strMenuId + strParentHierarchyIds;
cpeMenuLast.TargetControlID = "subpnlContent" + strParentMenuId + "_" + strMenuId;
cpeMenuLast.ExpandControlID = "cellContent" + strParentMenuId + "_" + strMenuId;
cpeMenuLast.CollapseControlID = "cellContent" + strParentMenuId + "_" + strMenuId;
cpeMenuLast.Collapsed = bCollapsed;
cpeMenuLast.TextLabelID = strMenuName;
cpeMenuLast.ExpandedText = m_strButtonLabelHide;
cpeMenuLast.CollapsedText = m_strButtonLabelShow;
cpeMenuLast.ImageControlID = "imglnk" + strMenuId;
cpeMenuLast.CollapsedImage = "~/App_Themes/default/nbExpand.gif";
cpeMenuLast.ExpandedImage = "~/App_Themes/default/nbCollapse.gif";
cpeMenuLast.SuppressPostBack = true;
cpeMenuLast.ScrollContents = false;
//Add Everything
cellSubMenu.Controls.Add(subpnlContent);
cellSubMenu.Controls.Add(cpeMenuLast);
row.Cells.Add(cellSubMenu);
tbl.Rows.Add(row);
using (StringWriter sw = new StringWriter(sb))
{
using (HtmlTextWriter tw = new HtmlTextWriter(sw))
{
tbl.RenderControl(tw);
}
}
に戻り、何を書くために取得しようとしています
どうすればこの問題を解決できますか?