How to pass data from one control (ascx) to another?

Discussion in 'ASP .Net' started by simon, Jun 12, 2007.

  1. simon

    simon Guest

    Hello,
    relatively new .net programmer. using vb.net (v2.0)

    I have an aspx page that contains 2 user controls (ascx) on it.
    the left control is basically navigation hyperlinks
    the right control is basically content display depending on what was
    clicked in the left control.
    ** trying it this way to avoid using frames **

    I was hoping to get some help with was how to pass info to the right
    control what was selected from the left control (IDs, etc). can you
    specify a "target" like in frames in the URL of the nav link? not
    sure how to "call" the right control with data to drive its display.
    I'm looking to avoid using the main "page" as the URL in the nav
    control and then read the query string variables in the content
    control as I'm trying to avoid doing a full page read/refresh/reload,
    which leads into my next question...

    I'm also looking to have only the right control refresh itself and
    leave the remainder of the page untouched (as to not disrupt the
    current state of the nav links control, there is collapsible tree
    like display there). the nav control is populated by data from a
    database and fed into a label field (not generated in vb code). I'm
    pretty sure the only answer to that question is to use AJAX. so if
    you happened to know a good link to show how to do this I'd appreciate
    that too.

    thank you for reading this. simon
     
    simon, Jun 12, 2007
    #1
    1. Advertising

  2. Here I've documented the details you need to know to pass data between two
    user controls:
    http://SteveOrr.net/faq/PassDataBetweenControls.aspx
    http://SteveOrr.net/faq/PassDataToUserControl.aspx
    http://SteveOrr.net/faq/PassDataFromUserControl.aspx

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net



    "simon" <> wrote in message
    news:eek:...
    > Hello,
    > relatively new .net programmer. using vb.net (v2.0)
    >
    > I have an aspx page that contains 2 user controls (ascx) on it.
    > the left control is basically navigation hyperlinks
    > the right control is basically content display depending on what was
    > clicked in the left control.
    > ** trying it this way to avoid using frames **
    >
    > I was hoping to get some help with was how to pass info to the right
    > control what was selected from the left control (IDs, etc). can you
    > specify a "target" like in frames in the URL of the nav link? not
    > sure how to "call" the right control with data to drive its display.
    > I'm looking to avoid using the main "page" as the URL in the nav
    > control and then read the query string variables in the content
    > control as I'm trying to avoid doing a full page read/refresh/reload,
    > which leads into my next question...
    >
    > I'm also looking to have only the right control refresh itself and
    > leave the remainder of the page untouched (as to not disrupt the
    > current state of the nav links control, there is collapsible tree
    > like display there). the nav control is populated by data from a
    > database and fed into a label field (not generated in vb code). I'm
    > pretty sure the only answer to that question is to use AJAX. so if
    > you happened to know a good link to show how to do this I'd appreciate
    > that too.
    >
    > thank you for reading this. simon
    >
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jun 12, 2007
    #2
    1. Advertising

  3. simon

    simon Guest

    simon, Jun 13, 2007
    #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. Quentin
    Replies:
    1
    Views:
    522
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    517
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,981
    Holger (David) Wagner
    Jul 3, 2004
  4. Joe
    Replies:
    1
    Views:
    413
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  5. Ivo Roupa
    Replies:
    0
    Views:
    177
    Ivo Roupa
    May 19, 2010
Loading...

Share This Page