Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Component in WebForm

Reply
Thread Tools

Component in WebForm

 
 
Shawn B.
Guest
Posts: n/a
 
      09-07-2003
Greetings,

Is it possible to get a reference to the Page object of an ASP.NET page from
within a Component that has been placed on the page?

I want the component to be available on the page and when the page renders I
want it to be able to inject something into the Page Response stream but the
Component object itself is very non-visual and for that reason I thought it
would be better not to have it as a control.


Thanks,
Shawn


 
Reply With Quote
 
 
 
 
Shawn B.
Guest
Posts: n/a
 
      09-07-2003
Actually, I need access to the RegisterClientScript function...


Thanks,
Shawn

"Shawn B." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings,
>
> Is it possible to get a reference to the Page object of an ASP.NET page

from
> within a Component that has been placed on the page?
>
> I want the component to be available on the page and when the page renders

I
> want it to be able to inject something into the Page Response stream but

the
> Component object itself is very non-visual and for that reason I thought

it
> would be better not to have it as a control.
>
>
> Thanks,
> Shawn
>
>



 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      09-07-2003
"Shawn B." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings,
>
> Is it possible to get a reference to the Page object of an ASP.NET page

from
> within a Component that has been placed on the page?
>
> I want the component to be available on the page and when the page renders

I
> want it to be able to inject something into the Page Response stream but

the
> Component object itself is very non-visual and for that reason I thought

it
> would be better not to have it as a control.


If it's going to emit something, even if it's "non-visual", then you should
probably make it a control.
--
John Saunders
Internet Engineer
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
David Rothgery
Guest
Posts: n/a
 
      09-08-2003

"Shawn B." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings,
>
> Is it possible to get a reference to the Page object of an ASP.NET page

from
> within a Component that has been placed on the page?


Use HttpContext.Current .
HTH.


--
Dave Rothgery
(E-Mail Removed)


 
Reply With Quote
 
Shawn B.
Guest
Posts: n/a
 
      09-08-2003
That didn't work because, while I could get access to the Request/Response
objects, I need the page itself.

So, I casted the HttpContext.Current.Handler to a page object and that
worked.

The only last thing I need to figure out is how to get the name of the
instance of the Component. There is a Name property in the property editor
for the component but there is no Name for the object (or ID) so unless I
can figure out how to uniquely identify a particular instance of the
component then I still am not there.

Is there a way I can get a handle to an instnace of the component attached
to the Form?


Thanks,
Shawn

"David Rothgery" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Shawn B." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Greetings,
> >
> > Is it possible to get a reference to the Page object of an ASP.NET page

> from
> > within a Component that has been placed on the page?

>
> Use HttpContext.Current .
> HTH.
>
>
> --
> Dave Rothgery
> (E-Mail Removed)
>
>



 
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
Open Another webform without closing the current webform ? Luqman ASP .Net 2 04-11-2007 02:43 AM
Moving value from popup Webform to main Webform? =?Utf-8?B?Vk1J?= ASP .Net 1 10-09-2006 05:15 PM
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM



Advertisments