Request.Querystring and User Control in .Net 2.0

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bA==?=, Jun 15, 2007.

  1. This may be a stupid question but...

    How do I programmtically access the page's request.querystring value in a
    custom user control.

    I tried doing this in the page_load routine of the user control but I do not
    seem to be able to access the value?

    TIA.
    =?Utf-8?B?UGF1bA==?=, Jun 15, 2007
    #1
    1. Advertising

  2. Did you try Page.Request.QueryString?

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



    "Paul" <> wrote in message
    news:...
    > This may be a stupid question but...
    >
    > How do I programmtically access the page's request.querystring value in a
    > custom user control.
    >
    > I tried doing this in the page_load routine of the user control but I do
    > not
    > seem to be able to access the value?
    >
    > TIA.
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jun 15, 2007
    #2
    1. Advertising

  3. Yes, I fixed the issue. It had to do with how I coded the page_load
    subroutine.

    A bigger question:

    I declare a variable in the main page. I want to pass that variable to the
    user control. How do I do this? Is there an example somewhere?

    Thanks for you assistance.


    "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:

    > Did you try Page.Request.QueryString?
    >
    > --
    > I hope this helps,
    > Steve C. Orr,
    > MCSD, MVP, CSM, ASPInsider
    > http://SteveOrr.net
    >
    >
    >
    > "Paul" <> wrote in message
    > news:...
    > > This may be a stupid question but...
    > >
    > > How do I programmtically access the page's request.querystring value in a
    > > custom user control.
    > >
    > > I tried doing this in the page_load routine of the user control but I do
    > > not
    > > seem to be able to access the value?
    > >
    > > TIA.

    >
    =?Utf-8?B?UGF1bA==?=, Jun 15, 2007
    #3
  4. Your control should expose a public property that can be set by the page.
    I've documented this in more detail here:
    http://SteveOrr.net/faq/PassDataToUserControl.aspx
    http://SteveOrr.net/faq/PassDataBetweenControls.aspx

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


    "Paul" <> wrote in message
    news:...
    > Yes, I fixed the issue. It had to do with how I coded the page_load
    > subroutine.
    >
    > A bigger question:
    >
    > I declare a variable in the main page. I want to pass that variable to the
    > user control. How do I do this? Is there an example somewhere?
    >
    > Thanks for you assistance.
    >
    >
    > "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:
    >
    >> Did you try Page.Request.QueryString?
    >>
    >> --
    >> I hope this helps,
    >> Steve C. Orr,
    >> MCSD, MVP, CSM, ASPInsider
    >> http://SteveOrr.net
    >>
    >>
    >>
    >> "Paul" <> wrote in message
    >> news:...
    >> > This may be a stupid question but...
    >> >
    >> > How do I programmtically access the page's request.querystring value in
    >> > a
    >> > custom user control.
    >> >
    >> > I tried doing this in the page_load routine of the user control but I
    >> > do
    >> > not
    >> > seem to be able to access the value?
    >> >
    >> > TIA.

    >>
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jun 15, 2007
    #4
  5. Your first example uses a method. I think I will need a property. Is there an
    example for that?

    Thank you very much.

    - Paul



    "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:

    > Your control should expose a public property that can be set by the page.
    > I've documented this in more detail here:
    > http://SteveOrr.net/faq/PassDataToUserControl.aspx
    > http://SteveOrr.net/faq/PassDataBetweenControls.aspx
    >
    > --
    > I hope this helps,
    > Steve C. Orr,
    > MCSD, MVP, CSM, ASPInsider
    > http://SteveOrr.net
    >
    >
    > "Paul" <> wrote in message
    > news:...
    > > Yes, I fixed the issue. It had to do with how I coded the page_load
    > > subroutine.
    > >
    > > A bigger question:
    > >
    > > I declare a variable in the main page. I want to pass that variable to the
    > > user control. How do I do this? Is there an example somewhere?
    > >
    > > Thanks for you assistance.
    > >
    > >
    > > "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:
    > >
    > >> Did you try Page.Request.QueryString?
    > >>
    > >> --
    > >> I hope this helps,
    > >> Steve C. Orr,
    > >> MCSD, MVP, CSM, ASPInsider
    > >> http://SteveOrr.net
    > >>
    > >>
    > >>
    > >> "Paul" <> wrote in message
    > >> news:...
    > >> > This may be a stupid question but...
    > >> >
    > >> > How do I programmtically access the page's request.querystring value in
    > >> > a
    > >> > custom user control.
    > >> >
    > >> > I tried doing this in the page_load routine of the user control but I
    > >> > do
    > >> > not
    > >> > seem to be able to access the value?
    > >> >
    > >> > TIA.
    > >>

    >
    =?Utf-8?B?UGF1bA==?=, Jun 15, 2007
    #5
    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. Daniel Bass
    Replies:
    2
    Views:
    3,695
    dave wanta
    Jul 4, 2003
  2. George
    Replies:
    5
    Views:
    6,588
    George
    Apr 2, 2004
  3. michaaal
    Replies:
    6
    Views:
    397
    Michael D. Kersey
    Jul 15, 2003
  4. John Davis
    Replies:
    2
    Views:
    372
    Dave Anderson
    Aug 18, 2003
  5. Ivan
    Replies:
    5
    Views:
    149
Loading...

Share This Page