Request.Querystring and User Control in .Net 2.0

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.
 
G

Guest

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.
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

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.
 
G

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top