throw an application wide event in an asp.net page

Discussion in 'ASP .Net' started by PrashanthNagaraj, Nov 23, 2003.

  1. How to throw an event in an asp.net page and handle that
    event on another page such that the page where the event
    is handled is posted back to the server in response to the
    event. For Example if I click a button in a.aspx page ,
    b.aspx page should pop out in a different window and if I
    select a text from a listbox in b.aspx then how do iI
    close b.aspx and render the selected text(in b.aspx) to a
    text box in a.aspx?
     
    PrashanthNagaraj, Nov 23, 2003
    #1
    1. Advertising

  2. PrashanthNagaraj

    Alvin Bruney Guest

    Good programming practice mandates that objects thrown be associated with
    exceptions or runtime anomalies. Attempting to throw an event works contrary
    to this standard, subverts the exception mechanism and makes code
    maintainability and re-use unnecessarily difficult.

    If what you want to do is pop out windows, I suggest you use a combination
    of javascript window.open(b.aspx) to call the other page and caching,
    context object or query string parameters to pass values between pages.

    In your case you would do this from a.aspx
    [snip]
    session["value"] = myValue;
    Response.Write("<script>window.open('b.aspx')</script>");

    In b.aspx page _ load
    if(session["value"] != null)
    {
    string val = session["value"]
    }

    regards

    Server.Transfer("b.aspx")

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "PrashanthNagaraj" <> wrote in message
    news:000201c3b1db$e8252b10$...
    > How to throw an event in an asp.net page and handle that
    > event on another page such that the page where the event
    > is handled is posted back to the server in response to the
    > event. For Example if I click a button in a.aspx page ,
    > b.aspx page should pop out in a different window and if I
    > select a text from a listbox in b.aspx then how do iI
    > close b.aspx and render the selected text(in b.aspx) to a
    > text box in a.aspx?
     
    Alvin Bruney, Nov 23, 2003
    #2
    1. Advertising

  3. PrashanthNagaraj

    Guest Guest

    Prashanth,

    You can also use simple JavaScript to satisfy your
    requirement.

    >-----Original Message-----
    >Good programming practice mandates that objects thrown be

    associated with
    >exceptions or runtime anomalies. Attempting to throw an

    event works contrary
    >to this standard, subverts the exception mechanism and

    makes code
    >maintainability and re-use unnecessarily difficult.
    >
    >If what you want to do is pop out windows, I suggest you

    use a combination
    >of javascript window.open(b.aspx) to call the other page

    and caching,
    >context object or query string parameters to pass values

    between pages.
    >
    >In your case you would do this from a.aspx
    >[snip]
    >session["value"] = myValue;
    >Response.Write("<script>window.open('b.aspx')</script>");
    >
    >In b.aspx page _ load
    >if(session["value"] != null)
    >{
    > string val = session["value"]
    >}
    >
    >regards
    >
    >Server.Transfer("b.aspx")
    >
    >--
    >
    >
    >-----------
    >Got TidBits?
    >Get it here: www.networkip.net/tidbits
    >"PrashanthNagaraj" <> wrote in

    message
    >news:000201c3b1db$e8252b10$...
    >> How to throw an event in an asp.net page and handle that
    >> event on another page such that the page where the event
    >> is handled is posted back to the server in response to

    the
    >> event. For Example if I click a button in a.aspx page ,
    >> b.aspx page should pop out in a different window and if

    I
    >> select a text from a listbox in b.aspx then how do iI
    >> close b.aspx and render the selected text(in b.aspx) to

    a
    >> text box in a.aspx?

    >
    >
    >.
    >
     
    Guest, Nov 24, 2003
    #3
    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. Web Developer

    char 8bit wide or 7bit wide in c++?

    Web Developer, Jul 31, 2003, in forum: C++
    Replies:
    2
    Views:
    614
    John Harrison
    Jul 31, 2003
  2. Disc Magnet
    Replies:
    2
    Views:
    737
    Jukka K. Korpela
    May 15, 2010
  3. Disc Magnet
    Replies:
    2
    Views:
    818
    Neredbojias
    May 14, 2010
  4. Burt

    Throw errors firm-wide to a web service?

    Burt, Aug 5, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    141
    John Saunders
    Aug 6, 2006
  5. Martin Rinehart

    80 columns wide? 132 columns wide?

    Martin Rinehart, Oct 31, 2008, in forum: Javascript
    Replies:
    16
    Views:
    193
    John W Kennedy
    Nov 13, 2008
Loading...

Share This Page