Click here to Skip to main content
12,063,645 members (70,246 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
Hi All,

This problem is in asp.net.

I am opening doProcess.aspx from default.aspx page using JS.
I have some server side code in page load of doProcess.aspx, I want to close doProcess.aspx window once server side code get executed.

Please advice how can I achive this.


default.aspx

function CallNewPage()
{
window.open('GenerateStatements.aspx');
}

doProcess.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
//some server side code
}


If I write window.close in CallNewPage() method, It won't execute server side code completely.


I have tried to close window from server side instead client side, but problem is still exists

doProcess.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
//some server side code
Page.ClientScript.RegisterClientScriptBlock(GetType(), "GenerateStatement1", "window.close();", true);
}


Please advice if you have any idea.

Regards,
Nagraj Naik
Posted 13-Feb-13 23:31pm
Edited 14-Feb-13 0:13am
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I have tried to close window from server side instead client side, but problem is still exists

doProcess.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
//some server side code
Page.ClientScript.RegisterClientScriptBlock(GetType(), "GenerateStatement1", "window.close();", true);
}



Regards,
Nagraj
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160204.4 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100