open webform with client script but cant close it

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

    open webform with client script but cant close it

    Hi,

    I 've a problem. Consider 2 webforms
    webform1 got a button: in the Page_Load event, this code:

    Button1.Attribu tes.Add("onclic k",
    "window.showMod alDialog('webfo rm2.aspx',null, 'status:no;dial ogWidth:370px;d ialogHeight:220 px;dialogHide:t rue;help:no;scr oll:no');")

    the 2nd form got a button2 in the Page_Load event, this code:

    Button2.Attribu tes.Add("onclic k", "window.close() ;")

    what happens is that the second dialog is a nice pop-up, but after closing
    it is closed and RELOADED again (but then not as modal form and not in the
    specified height/width

    What am I doing wrong??


    Ton




  • Eliyahu Goldin

    #2
    Re: open webform with client script but cant close it

    Add this line to the <headsection of the page you open as a modal dialog:

    <base target="_self"/>

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]




    "ton" <ton@nospam.nlw rote in message
    news:b5943$47bd 6bff$541eee8e$1 3678@cache3.til bu1.nb.home.nl. ..
    Hi,
    >
    I 've a problem. Consider 2 webforms
    webform1 got a button: in the Page_Load event, this code:
    >
    Button1.Attribu tes.Add("onclic k",
    "window.showMod alDialog('webfo rm2.aspx',null, 'status:no;dial ogWidth:370px;d ialogHeight:220 px;dialogHide:t rue;help:no;scr oll:no');")
    >
    the 2nd form got a button2 in the Page_Load event, this code:
    >
    Button2.Attribu tes.Add("onclic k", "window.close() ;")
    >
    what happens is that the second dialog is a nice pop-up, but after closing
    it is closed and RELOADED again (but then not as modal form and not in the
    specified height/width
    >
    What am I doing wrong??
    >
    >
    Ton
    >
    >
    >
    >

    Comment

    • ton

      #3
      Re: open webform with client script but cant close it

      WOUW

      it worked great thanks

      Ton

      "Eliyahu Goldin" <REMOVEALLCAPIT ALSeEgGoldDinN@ mMvVpPsS.orgsch reef in
      bericht news:uZMQorIdIH A.2268@TK2MSFTN GP02.phx.gbl...
      Add this line to the <headsection of the page you open as a modal
      dialog:
      >
      <base target="_self"/>
      >
      --
      Eliyahu Goldin,
      Software Developer
      Microsoft MVP [ASP.NET]


      >
      >
      "ton" <ton@nospam.nlw rote in message
      news:b5943$47bd 6bff$541eee8e$1 3678@cache3.til bu1.nb.home.nl. ..
      >Hi,
      >>
      >I 've a problem. Consider 2 webforms
      >webform1 got a button: in the Page_Load event, this code:
      >>
      >Button1.Attrib utes.Add("oncli ck",
      >"window.showMo dalDialog('webf orm2.aspx',null ,'status:no;dia logWidth:370px; dialogHeight:22 0px;dialogHide: true;help:no;sc roll:no');")
      >>
      >the 2nd form got a button2 in the Page_Load event, this code:
      >>
      >Button2.Attrib utes.Add("oncli ck", "window.close() ;")
      >>
      >what happens is that the second dialog is a nice pop-up, but after
      >closing
      >it is closed and RELOADED again (but then not as modal form and not in
      >the
      >specified height/width
      >>
      >What am I doing wrong??
      >>
      >>
      >Ton
      >>
      >>
      >>
      >>
      >
      >

      Comment

      Working...