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

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

close pop up and refresh main page after popup close

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
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/

View Complete Post

More Related Resource Links

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...



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.



Refresh Parent Page List after Edit Item Modal Dialog Save/Close

I am calling the Edit Item URL (EditForm.aspx?ID=x&IsDlg=1) via javascript code to bring up the Edit Item Modal Dialog. This works fine and dandy. But what callbackfunction should I invoke after the Save so that the parent list is refreshed? Is there a better way to do it than call reload on the entire parent frame? It almost looks like there should be a way to refresh just the list. Any help appreciated. Thanks, Jake.

How to close the sharepoint modal dialog and refresh the parent page using Server side API?

I am trying to find a way to close a modal page that has been opened with the click event of ribbon control. Once the modal dialog is opened, I'm showing 'OK' button for the user to confirm some action on the respective list item. If the user clicks on 'OK', I'm performing some action on the listitem using server side code. Here the problem for me is, once the action is completed on this listItem, I need to close the dialog and refresh the parent page (AllItem.aspx) using *sharepoint server side

I'm aware that for closing the dialog we have JS code "SP.UI.ModalDialog.commonModalDialogClose". But this is not useful for me, because I should first run some action on the listitem and once that action is complete, then only I should close this dialog.

Close a Popup Window page from Code Behind


Good Morning,

I am using the ClientScriptManager class to call a java alert from Code Behind when a condition is not met. This is being done from a page that is already a JavaScript pop up. When the alert is responded to, I want the script to close both the alert AND the page that generated the alert. Everything works as designed until I close the alert window...THEN the user is also forced to close a second page (the original generating page for the alert) to return to the starting point. This seems cumbersome and unprofessional. I Googled a bunch of stuff but cannot seem to come up with just the right one. What I have currently is below. I appreciate any assistance...Thank You, Pat

        if (RadioButtonSelect.Checked == false)
string msg = "My String";
ClientScriptManager script = Page.ClientScript;
if (!script.IsClientScriptBlockRegistered(this.GetType(), "Alert"))
script.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('" + msg + "')", true);

SharePoint popup close and refresh parent form



I am using MOSS 2007 and I have a requirement:

The user should be able to create a new quick link on a popup window.  So I have created a custom NewForm.aspx that is a popup.  Now I need that when the data is filled the popup closes and the parent form get refresh.

This is the code for the Save button:  <SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2" />

I am unable to place javascript in there.  I had been reading a lot of forum but still unable to find an answer.  Please let me know how to achive this.

Thank you




Refresh Parent Page when close the jquery dialog



I have to open PopupPage.aspx from MainPage.aspx using jquery Dialog. For this i have added the iframe inside the Div and loaded the PopupPage.aspx in the iframe. 


    <link href="inc/css/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="inc/scripts/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="inc/scripts/jquery-ui-1.8.6.custom.min.js"></script>

    <script type="text/javascript" language="javascript">
        function OpenJQueryDialog()
            $('#dialog-modal').dialog({ autoOpen: false, bgiframe: true, modal: true });                         

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

Page does not close after Response.BinaryWrite when opened in IE 6 sp 3

Hi all, I currently having problems in closing a page opened using IE 6 sp 3 after Response.BinaryWrite. All other versions of IE it closes fine. This page was opened using window.open. Below is a sample code of what i am trying to achieve: protected void Page_Load(object sender, EventArgs e) {            Response.Clear();  //Specify the document type.  Response.ContentType = "application/word";  //Specify how the document is sent to the browser.  Response.AddHeader("content-disposition", "attachment; filename=MyDasddsaocument.doc");  //Get data bytes from the file and send it to the response.  byte[] bytes = System.IO.File.ReadAllBytes(@"C:\\Temp\\in.doc");  Response.BinaryWrite(bytes);  Response.End();  Page.ClientScript.RegisterStartupScript(this.GetType(), "CloseMe", "window.close();", true); } I hope someone  can help me with this issue. Thank you in advance.

Detecting a page close using GetCallbackEventReference IIS6/IIS7 Issue

I have a popup page that when closed,  initiates a server side function that updates a DB table.  After looking at countless posts, I was able to use the following code (partial) to generate the callback when the window closes. The problem I'm having is that it works great on a server with IIS7, but the event doesn't fire on one with IIS6. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load    If Not IsPostBack Then        Dim callBackReference As String = Page.ClientScript.GetCallbackEventReference(Me, "arg", "LogOutUser", "", True)        Dim logOutUserCallBackScript As String = "function LogOutUserCallBack(arg, context) { " & callBackReference & "; }"       Me.ClientScript.RegisterClientScriptBlock(Me.GetType(), "LogOutUserCallBack", logOutUserCallBackScript, True)    End If  End Sub      Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult               Return _callBackStatus    End Function     Public Sub RaiseCallbackEvent(ByVal eventA

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

how to show popup when we close the browser

i want the wen i close the browser a popup should come confirm r u sure u 
want 2 exit if yes the browser should close and current date should be saved into the database.
i have tryied a code as
protected void Page_UnLoad(object sender, EventArgs e)

DateTime d = System.DateTime.Now;
string cn = "Data Source=hcl;Initial Catalog=mydata;Integrated Security=True";
SqlConnection con = new SqlConnection(cn);
SqlCommand cmd = new SqlCommand("insert into mydate values(@d)", con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new SqlParameter("@d", d));
// cmd.Parameters.Add(new SqlParameter("@b", b));


but it was not succesful also before i close the browser the data is saved in the database.also i dont know how to call alert function 
as r u sure u want to exit .plz help

close aspx page after executing code behind


I am working in vs 2008, C#.

Load event in my aspx page is having a set of database operations .So after completing those operations i want to close the aspx page.

for that i am calling 

window.close() methond onload event of the body. Its closing the aspx page but it is showing the confirmation message before closing the page.

I dont want to show that message box.

How can i claose an aspx page without showing any message?.

Pls help me



How to Trap a "Page Back" or "Page Close" or "Tab Close" Event


 VWD 2008 Express.  Visual Basic.

I have seen pages on the net that when you try to navigate away, they pop up a message asking whether you really want to navigate away.  How can I accomplish this to detect someone hitting the "page back" arrow in a browser or the "x" that closes a browser page or when someone tries to close a browser tab?  Thanks for the help.

How to refresh page and dropdown after insert record from popup page


I have a page that is opened in a popup window from the main page. Once i click insert it pops up a message that says you have successfully added blah blah. Then once you click ok it closes the popup page and goes back to the main page. I want to be able to refresh the main page back to how it was when you first land on the page. Here is the code for my insert button:


 <asp:button id="insertButton" 
                    style="background-image:url('Images/Button.gif'); text-align:center;background-color:Transparent; cursor:hand; background-repeat:no-repeat; background-position:left; padding-left:15px; font-family: 'Arial Unicode MS'; font-size: small; font-weight: bold;" 
                    Runat="server" Height="25px" BorderStyle=None ForeColor=White    Text="Insert" 
                    Width="99px" CssClass="style13" CommandName="Insert" OnClientClick="javascript: alert('You have successfully added a New Donor!!');window.open('','_self','');window.close();" />


Close a Page in WPF

I am making a wizad with several pages (System.Windows.Controls.Page) and Prev,Next buttons. Finnaly I want to close the last page or even earlier for the previous pages in the wizard. I have a button (called Close) and I simply want when I click on it to close the current page from the wizard. Can somebody help me with this issue?

Thanks in advance Smile

close popup form and open again

when i click a button, then prompt another form and then i click close button at the upper right corner of the form
the popup form is closed
then i click a button again, then prompt a popup form again
but now when is popup form is prompt at second time,it always trigger form_closing event,why?
how to prevent it?
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