Click here to Skip to main content
11,492,523 members (66,390 online)
Rate this: bad
good
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
0 Sergey Alexandrovich Kryukov 454
1 Maciej Los 266
2 KarstenK 210
3 CPallini 208
4 Sascha Lefèvre 190
0 Sergey Alexandrovich Kryukov 10,062
1 OriginalGriff 8,620
2 Sascha Lefèvre 3,609
3 Maciej Los 3,372
4 Richard Deeming 2,500


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2015
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