close subwindow using vb.net

Discussion in 'ASP .Net' started by Marcel, Apr 15, 2004.

  1. Marcel

    Marcel Guest

    I have a subwindow hich displays a grid. When the user selects a row from
    the grid, I wish to store the selected row ID in session state and close the
    subwindow, returning focus to the parent (opener).

    Normally I would do this in javascript, but I cannot find any client side
    intelligence in the grid, so I wish to close the window on the select index
    changed event when I return to the server.

    I can't remeber how to add an OnLoad attribute to the <BODY> tag - as that
    would do it.

    Please help.
    Marcel
     
    Marcel, Apr 15, 2004
    #1
    1. Advertising

  2. For do this normally I use the RegisterClientScriptBlock() method of Page.

    Example :
    string s = "<script>window.close();</script>";
    RegisterClientScriptBlock("close", s);

    If you want to put code in onload you can make body runat=server and then
    declare this in your page as generic HtmlControl so you can write :
    html.Attributes["OnLoad"] = ".....";

    you can write all your javascript here, or call a function and then put it
    on client with RegisterStartupScript method (the use is similar to
    RegisterClientScriptBlock)!

    Brun.


    "Marcel" <> wrote in message
    news:...
    > I have a subwindow hich displays a grid. When the user selects a row from
    > the grid, I wish to store the selected row ID in session state and close

    the
    > subwindow, returning focus to the parent (opener).
    >
    > Normally I would do this in javascript, but I cannot find any client side
    > intelligence in the grid, so I wish to close the window on the select

    index
    > changed event when I return to the server.
    >
    > I can't remeber how to add an OnLoad attribute to the <BODY> tag - as that
    > would do it.
    >
    > Please help.
    > Marcel
    >
    >
     
    Bruno Sirianni, Apr 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Iñaki Baz Castillo
    Replies:
    7
    Views:
    941
    Iñaki Baz Castillo
    Jan 12, 2010
  2. Hugo
    Replies:
    2
    Views:
    177
  3. Paul Moffitt

    Subwindow title bar

    Paul Moffitt, Apr 16, 2004, in forum: Javascript
    Replies:
    2
    Views:
    150
    Michael Winter
    Apr 17, 2004
  4. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    423
    Gérard Talbot
    Sep 2, 2005
  5. Wolf Grossi

    subwindow - refresh parent.

    Wolf Grossi, Jul 24, 2007, in forum: Javascript
    Replies:
    0
    Views:
    87
    Wolf Grossi
    Jul 24, 2007
Loading...

Share This Page