Request.Querystring and User Control in .Net 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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 said:
Did you try Page.Request.QueryString?

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



Paul said:
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.
 
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 said:
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 said:
Did you try Page.Request.QueryString?

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



Paul said:
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.
 
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 said:
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 said:
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 said:
Did you try Page.Request.QueryString?

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



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.
 
Back
Top