如何在回发后显示模型PopUp

如何在回发后显示模型PopUp

本文介绍了如何在回发后显示模型PopUp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi guys .. 
model pop up is dissapears after any post back .? . in this i hav one drop down list if i select any item in drop down   Modal Popup disappears . 




<form id="form1" runat="server">
  <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
  </asp:ToolkitScriptManager>
  <div>
      <asp:Panel ID="pnModelPopup" runat="server" CssClass="popup">
          <table>
              <tr>
                  <td>
                      User Name:
                  </td>
                  <td>
                      <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                  </td>
              </tr>

              <tr>
                  <td>
                      <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                  </td>
              </tr>
              <tr>
              <td>
              <asp:DropDownList runat="server" ID="drp" AutoPostBack="True"
                      onselectedindexchanged="drp_SelectedIndexChanged">
                  <asp:ListItem>a</asp:ListItem>
                  <asp:ListItem>a</asp:ListItem>
                  </asp:DropDownList>
              </td>
              </tr>
          </table>
      </asp:Panel>
      <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="pnModelPopup"
          TargetControlID="lnkbtnSignin" DropShadow="true" BackgroundCssClass="modalBackground"
          PopupDragHandleControlID="pnModelPopup" OnOkScript="onOk()">
      </asp:ModalPopupExtender>
      <div style="margin-removed 300px">
          <asp:LinkButton ID="lnkbtnSignin" runat="server">Sign in</asp:LinkButton>
      </div>
  </div>
  </form>







 please tell me guys how to show model pop up after post  back  . . please help me 
thank u. .

推荐答案

protected void Page_Load(object sender, EventArgs e)
       {
           if (IsPostBack)
               ModalPopupExtender1.Show();
       }
protected void btnCancel_Click(object sender, EventArgs e)
       {
           ModalPopupExtender1.Hide();
       }



包含以下代码。


Include the following codes.


这篇关于如何在回发后显示模型PopUp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 15:50