3 Replies - 15973 Views - Last Post: 27 November 2008 - 09:36 AM

#1 hassankhn123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-November 08

who to close web form using asp.net

Post icon  Posted 27 November 2008 - 01:45 AM

plz send me as soon as possible?
Is This A Good Question/Topic? 0
  • +

Replies To: who to close web form using asp.net

#2 b.ihde  Icon User is offline

  • D.I.C for life
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,070
  • Joined: 29-September 08

Re: who to close web form using asp.net

Posted 27 November 2008 - 03:03 AM

The C# coding to close a window form is:

In the main form when close button is clicked the event is passed to the event handler OnClose.

private void OnClose (object sender , EventArgs e)
{
Close();
}


Hope this helps.

B.ihde
Was This Post Helpful? 0
  • +
  • -

#3 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: who to close web form using asp.net

Posted 27 November 2008 - 08:06 AM

View Postb.ihde, on 27 Nov, 2008 - 05:03 AM, said:

The C# coding to close a window form is:

In the main form when close button is clicked the event is passed to the event handler OnClose.

private void OnClose (object sender , EventArgs e)
{
Close();
}


Hope this helps.

B.ihde


sadly, ASP.Net doesn't have a "Close" method.

You will need to use javascript.

Response.Write("<script language='javascript'> window.close();</javascript>");


Was This Post Helpful? 0
  • +
  • -

#4 b.ihde  Icon User is offline

  • D.I.C for life
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,070
  • Joined: 29-September 08

Re: who to close web form using asp.net

Posted 27 November 2008 - 09:36 AM

View Posteclipsed4utoo, on 27 Nov, 2008 - 07:06 AM, said:

sadly, ASP.Net doesn't have a "Close" method.

You will need to use javascript.

Response.Write("<script language='javascript'> window.close();</javascript>");



ahhh yes of course! my fault... I was too deep in C# that time :blink:

thx!

regards

B.ihde

This post has been edited by b.ihde: 27 November 2008 - 09:37 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1