Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Request.Querystring and User Control in .Net 2.0

Reply
Thread Tools

Request.Querystring and User Control in .Net 2.0

 
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      06-15-2007
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.
 
Reply With Quote
 
 
 
 
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
Posts: n/a
 
      06-15-2007
Did you try Page.Request.QueryString?

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



"Paul" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      06-15-2007
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.

>

 
Reply With Quote
 
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
Posts: n/a
 
      06-15-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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.

>>


 
Reply With Quote
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      06-15-2007
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > 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.
> >>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Databinding in a user control that contains another user control StraussGuy@hotpop.com ASP .Net 0 01-07-2005 04:55 PM
Event not firing for user control inside user control vatech1993 ASP .Net 4 12-11-2004 02:51 PM
Manipulating a User Control from another User Control Tom Rowton ASP .Net 2 08-01-2003 08:18 PM



Advertisments