Click here to Skip to main content
11,716,938 members (83,824 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 22:31pm
Edited 13-Feb-13 23:13pm
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 659
1 F-ES Sitecore 260
2 Maciej Los 185
3 OriginalGriff 175
4 Richard MacCutchan 140
0 Sergey Alexandrovich Kryukov 1,029
1 Maciej Los 464
2 Richard MacCutchan 430
3 CHill60 415
4 OriginalGriff 415


Advertise | Privacy | Mobile
Web04 | 2.8.150901.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