0
我試圖用__DePostBack
調用服務器更新內容面板,HTTP服務器端被觸發,但面板不會更新,更新面板
更新面板是自定義服務器控件並且它對頁面上下文不熟悉,我只能通過以下方式訪問它:FindControl("Update Panel ID")
,
我如何使更新面板更新?
Default.aspx.cs代碼:
protected void Page_Load(object sender, EventArgs e)
{
string _action = this.Request.Params.Get("__EVENTTARGET");
if (_action == "XX")
{
UpdatePanel pnl = ((UpdatePanel)TabControl1.FindControl("UpdatePanel ID"));
UserControl uc = (UserControl)LoadControl("MyForm.ascx");
pnl.ContentTemplateContainer.Controls.Clear();
pnl.ContentTemplateContainer.Controls.Add(uc);
}
}
Default.aspx的代碼:
<SDMS:TabControl ID="TabControl1" BorderColor="#00F" runat="server" class="tabswrapper">
<TabPages>
<SDMS:TabPage ID="TabPage6" runat="server" UpdateContent="UpdatePanel1" Title="Two">
<TabBody>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ContentTemplate>
</asp:UpdatePanel>
</TabBody>
</SDMS:TabPage>
</TabPages>
</SDMS:TabControl>
我怎樣才能使新面板更新?