我顯示了ajaxcontrol工具包ModalPopupExtender,以顯示從按鈕單擊後面的代碼。 在我的按鈕上單擊我上傳文件和發送電子郵件,並在電子郵件後,我顯示莫代爾彈出幾秒鐘,然後我將用戶重定向到索引頁。在代碼後面顯示模態彈出
我遇到的問題是,如果我不重定向 ModalPopup只顯示這是我的aspx代碼
<input type="btmodel" runat="server" style="display: none">
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btmodel"
PopupControlID="Panel1" PopupDragHandleControlID="PopupHeader" Drag="true" DropShadow="true"
OkControlID="OkButton" CancelControlID="CancelButton" BackgroundCssClass="ModalPopupBG">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="Panel1" Style="display: none" runat="server">
<div class="HellowWorldPopup">
<div class="PopupHeader" id="PopupHeader">
Progress</div>
<div class="PopupBody">
<p>
Processing.....</p>
</div>
<div class="Controls">
<input id="btnOkay" type="button" value="Ok" onclick="OkScript()" />
</div>
</div>
</asp:Panel>
和我按一下按鈕的代碼
protected void btnupload_Click(object sender, EventArgs e)
{
//File uploading
//Sending Email
ModalPopupExtender1.Show();
Response.Redirect("Default.aspx");//If I comment this line,then modal is showing
}
我也試圖與此ModalPopupExtender1.Show()之前,但沒有運氣
System.Threading.Thread.Sleep(1000);