Command to close my page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there any Command that when I click on a button, My web page be close?
or it comes back to my previous page?

Thank you,
Monica
 
Monica,
this isn't really a C# language question. its a Javascript issue.

Here is a sample:

<input type="button" onclick ="javascript:window.close();" value="Close
It!" />
 
Hi,
Monica,
this isn't really a C# language question. its a Javascript issue.

Here is a sample:

<input type="button" onclick ="javascript:window.close();" value="Close
It!" />

Using javascript: is usually a bad idea, and can cause problems in some
browsers. Better to remove it.

Also as an addition for the OP: On the main page, calling window.close()
should cause the browser to ask the user if he really wants to close.

Greetings,
Laurent
 
Hello Laurent Bugnion,MVP.
there are ways to avoid that prompt.

-
shashank kadge.
Hi,
Monica,
this isn't really a C# language question. its a Javascript issue.
Here is a sample:
<input type="button" onclick ="javascript:window.close();" value="Close
It!" />

Using javascript: is usually a bad idea, and can cause problems in some
browsers. Better to remove it.

Also as an addition for the OP: On the main page, calling window.close()
should cause the browser to ask the user if he really wants to close.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog:http://www.galasoft-LB.ch
PhotoAlbum:http://www.galasoft-LB.ch/pictures
Support children in Calcutta:http://www.calcutta-espoir.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top