0
我正在測試一個簡單的Web應用程序中的ModalPopupExtender。用戶應該在modalpopup中輸入一個值,然後這個值會在關閉模式彈出框後顯示在父頁面中。從Modal Popup Extender的父頁面設置值
我用這個代碼的設計:
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Button runat="server" ID="BtnOpenPopup" Text="Open Popup" />
<asp:Label runat="server" ID="lbl" ></asp:Label>
<asp:Panel runat="server" ID="PnlTest">
<asp:TextBox runat="server" ID="txtInput"></asp:TextBox>
<asp:Button runat="server" ID="BtnSubmit" Text="Submit" OnClick="BtnSubmit_Click" />
</asp:Panel>
<ajaxToolkit:ModalPopupExtender runat="server" TargetControlID="BtnOpenPopup" EnableViewState="true" OkControlID="BtnSubmit" PopupControlID="PnlTest" ></ajaxToolkit:ModalPopupExtender>
</div>
</form>
</body>
</html>
而這背後是我的代碼:
protected void BtnSubmit_Click(object sender, EventArgs e)
{
lbl.Text = txtInput.Text;
}
這沒有工作,我沒有得到任何錯誤,但仍是lbl沒有加載用戶輸入。
如果你能告訴我一些關於它是如何工作的見解,我將不勝感激。
你檢查:http://stackoverflow.com/questions/2177227/need -help -with-a-simple-asp-net-modalpopupextender-example –
@Eray,謝謝,但是這個問題在鏈接中與我的無關。 – user3340627