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

Top 5 Contributors of the Month
Imran Ghani

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

PopUp Closing

Posted By: Aamrapali Tamgadge     Posted Date: March 04, 2011    Points:2   Category :ASP.Net
Hi..Me having one popup window and i want to close dat window on submit button and redirect to the new aspx page passing the session values.
i have write the below code the for closing it but it is not getting redirect to my new aspx page

string winclose = "<script language='javascript'>" + "self.parent.opener.location='TestResult.aspx?id=" + Session["ID"].ToString() + "&name=" + Session["Result"].ToString() + "&time=" + Session["time"].ToString() + "';" + "self.close()" + "</script>";
Page.RegisterClientScriptBlock("", winclose);

//and this is timeout function

Author: Maverick             
Posted Date: March 04, 2011     Points: 20   


Use this

string strScript ;
strScript += " window.opener.document.getElementById('ctl00_ContentPlaceHolder1_txtid').value = '" + session["Result"] + "';";
strScript += " window.close();";
strScript += " </script>";
ClientScript.RegisterStartupScript(this.GetType(), "CloseWindow", strScript);
Hope this helps


Author: Aamrapali Tamgadge             
Posted Date: March 04, 2011     Points: 20   

hi nw m using respose.redirect to go to next page but still my previous page popup is active simpli i want to close dat popup it is not getting close..pls give the solution of this

Software Programmer At OTIS ISRC
Author: Karthikeyan Anbarasan       [Moderator]      
Posted Date: March 04, 2011     Points: 20   

Call this js fn and try to close the window and then do a redirect

<a href="javascript:CloseWindow()">
<asp:button id="CancelButton" runat="server" Width="60px" CssClass="btn" Text="Cancel"></asp:button>

Write Script in Header Section

<script language="javascript" type="text/javascript">
function CloseWindow()

Mark as Answer if the answer solves your issue!!!

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

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