Close a window after button click

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    Close a window after button click

    The user clicks a buuton and the server does some
    processing. If successful I want to close the window.

    Any suggestions?


    Steve
  • Karl Seguin

    #2
    Re: Close a window after button click

    you could simply Response.Write the javascript to do a self.close() ala:

    Response.Write ("<script language='javas cript'>self.clo se();</script>")

    A more elegant solution might be to use Page.RegisterSt artupScript

    Karl

    "Steve" <stephendotholt @invudotnet> wrote in message
    news:091a01c340 77$efeb7fa0$a30 1280a@phx.gbl.. .[color=blue]
    > The user clicks a buuton and the server does some
    > processing. If successful I want to close the window.
    >
    > Any suggestions?
    >
    >
    > Steve[/color]


    Comment

    • Kevin Spencer

      #3
      Re: Close a window after button click

      Use Page.RegisterSt artupScript() to add the following JavaScript to the
      page:

      window.opener = self;
      window.close();

      It will close as soon as it reloads after the PostBack.

      HTH,

      Kevin Spencer
      Microsoft FrontPage MVP
      Internet Developer

      Big things are made up of
      lots of Little things.

      "Steve" <stephendotholt @invudotnet> wrote in message
      news:091a01c340 77$efeb7fa0$a30 1280a@phx.gbl.. .[color=blue]
      > The user clicks a buuton and the server does some
      > processing. If successful I want to close the window.
      >
      > Any suggestions?
      >
      >
      > Steve[/color]


      Comment

      Working...