.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cant close modalpopup

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net

I cant seem to close the modalpopup after the asynfileupload has completed.

The AsyncFileUpload1_UploadedComplete method is hit, but the popup isnt closed.

Here my code:

<asp:Button id="btnShowPopup" runat="server" Text="START UPLOADING" />

<cc1:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlUpload" CancelControlID="btnClose" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender>

<asp:Panel ID="pnlUpload" runat="server" style="display:none;" CssClass="mypopup">
<cc1:AsyncFileUpload ID="afuFlyerEdit1" OnUploadedComplete="AsyncFileUpload1_UploadedComplete" UploaderStyle="Modern" runat="server" />   
    <div style="text-align: right; width: 100%; margin-top: 5px;">
        <asp:Button ID="btnClose" runat="server" Text="Cancel" />

Protected Sub AsyncFileUpload1_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs)

View Complete Post

More Related Resource Links

Open ModalPopup dialog on page load


Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?

WebDev.WebServer.exe has encounted a problem and needs to close when trying to view page in browser


Hi, whenever I load an aspx page in vwde2008, I get the message in the subject of this post.  After I click Ok on that, I get a dialog box, Unable to Connect to the ASP.Net development center.  What can I do to troubleshoot?

I am using Windows XP SP3, vwde2008 with SP1, on a HP desktop.  Also using Office 2003 if that is relevant at all.

Thanks, Justin

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

How to set session timeout and clear session in asp.net C# ? And kill session when close the web app


hi ,

How to set session timeout and clear session in web.config and login.aspx  ? And when we close the web application , the session must be cleared ?

I have use session.abandon as per below but is not working . Pls advise .


        protected void btnLogout_Click(object sender, EventArgs e)



How to Use Window.close() in C#


Hello Alll

Please Tell me  How to Use Window.close() in C#.. In this case i have to handle both serverside event and client side..


Partial Views and Popups...After clicking on Close need to refresh the page....


Hi All,


I amusing the PopUp example as suggestedin the above forum link.....

But now i want to Refresh the page after clicking on Close(x) ...

So please help me....

Please advice...

Thanks in advance...



thickbox close



how to call below jquery (thickbox)  in codebehind

$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");         

Refresh parent window and close popup window.


Hi All,

I've been spent the last couple hours trying to work on this issue. I an creating Facebook Oauth stuff, when i click on parent window. The popup shows the Facebook login, when i logged in with my details, it redirects to my site. But i need to close this popup after returning and refrsh the parent window.

can you please provide me this kind of stuff. i already spent whole day in this... Sealed Cry

If i could solve this then i will go for another logic but stucked on 1st step.



setting label using modalpopup selected value


Hi all:

I have a modalpopup control which has  a gridview and search criteria. User selects a records and clicks modalpopup ok button ( which is set as modalpopup's okbutton). I have attached an event to okbutton click event. and inside this event, I am setting a label control which in on main page which called this modalpopup. I debugged code, it comes inside that event but doesnt set value. below is my event code.

protected void btnOkCustomers_Click(object sender, EventArgs e)


Int32 CustomerID = Convert.ToInt32(GridView2.SelectedDataKey.Value);

orders = new Orders();

DataSet CustomersDs = orders.GetCustomerById(CustomerID);

lblCustomerName.Text = "sadasdad"; // CustomersDs.Tables[0].Rows[0]["first_name"].ToString();




Please suggest me solution to this.

Asif Hameed

Close Tab doesn't logout


When closing my tab, Formsauthentication doesn't clear, thanks!

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

      if (Classes.CStaticDataAccess.AuthenticateUser(Login1.UserName, Login1.Password))
        FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Login1.UserName, DateTime.Now, DateTime.Now.AddMinutes(1), false, "");
        string secureTicket = FormsAuthentication.Encrypt(ticket);
        HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, secureTicket);
        string redirectUrl = FormsAuthentication.GetRedirectUrl(Login1.UserName, false);

       // System.Web.Security.FormsAuthentication.SetAuthCookie(Login1.UserName, false);
        e.Authenticated = true;

        e.Authenticated = false;

 <authentication mode="Forms">
      <forms name=".ASPXFORMSAUTH" loginUrl="~/Ware2Login.aspx" protection="All" timeout="30" path="/" ></forms>
      <deny users="?"/>

close pop up and refresh main page after popup close

I am working on a application in which When user clicks on a button  he should be redirected to facebook login page and after successfull login he shud be reirected back to my page. It all is working fine but now I have to do like thiswhen user click on the Button the the facebookbacklogin page shud be opened in popUp and when login is done successfully the popup window shud be closed and the main page shud be refreshed. anf If user is already login the popup window shud not be opened.How can i do this..How can I KNow that a popup window is opened and how can I close that??How to refresh when popup window is closed.I ahve to do like on this site..http://blippy.com/

close ColorBox after from submit

I'm looking for code examples on how to close ColorBox modal window with a click of a submit button of a contact form inside the modal dialog, Thanks...

list webpart, not using the sourse url, but referring back to the library view on close.

i have a webpart which brings a list in to my front page. -when user clicks, it shows  the item, and when he clicks on close,it takes him back to the library view. not back to the page,from where the request has initiated. we are using f5 load balancer, and our webapplications are extended. is there somesetup i am missing, so that i can make the sourse url's refer back to the originating page.        

How to delay the close() in client

HI,        I'm writing a WCF using wsDualHttpBinding as binding property, in my client side i specified the closeTimeout as 00:00:00, it throws the timout exception, when i closed the channel, using close() in client side code.   However, if i specify the closeTimeout  as 00:00:01, it will finish the close of channel, within 1 second. But for 0.01, 0.1 second it cannot able to close, now i want to specify a 30 second closeTimeout, and in the code behind i want to make the close to take more time to finish closing the channel. How can i make the close() to wait,   any idea,

Close all existing connections

I have written code to manage the partitions in a database. I see that this code gets deadlocked often because of some open connections.   Is there someway to close all existing connections?   I know of one approach which is to alter the database to a single user mode. ... but wanted to know if there is something more light weight.    

modalpopup and javascript error object required

Hi!   I Have this error when click on a button to open a popup box in my page: "object required"   Here is my code:   <%@ Page Language="VB" MasterPageFile="~/artm.master" AutoEventWireup="false" CodeFile="artm_principal.aspx.vb" Inherits="artm_principal" title="Principal" Debug="true" MaintainScrollPositionOnPostback="true"%><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AJT" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">                                      <AJT:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></AJT:ToolkitScriptManager>                                        <AJT:ModalPopupExtender ID="ModalPopupExtender1" runat="server"         &

turn off tag auto close

How do I turn off the feature where closing tags are automatically inserted when an opening tag is typed? I want all auto text turned off. Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend