SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    closing a page using RegisterStartupScript

    Page.ClientScript.RegisterStartupScript(Me.GetType(), "close", "window.close()", True)
    i am having asp.net application
    i want to close the page depending on condition

    i am using
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "close", "window.close()", True)

    but getting error

  2. #2
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are using the correct code to close the window. But, you can not close the windows, if it is not opened by the window.open method. (This can again be hardcoded in the RegisterStartupScript)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •