Component in WebForm

Discussion in 'ASP .Net Building Controls' started by Shawn B., Sep 7, 2003.

  1. Shawn B.

    Shawn B. Guest


    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.

    Shawn B., Sep 7, 2003
    1. Advertisements

  2. Shawn B.

    Shawn B. Guest

    Actually, I need access to the RegisterClientScript function...

    Shawn B., Sep 7, 2003
    1. Advertisements

  3. If it's going to emit something, even if it's "non-visual", then you should
    probably make it a control.
    John Saunders, Sep 7, 2003
  4. Use HttpContext.Current .
    David Rothgery, Sep 8, 2003
  5. Shawn B.

    Shawn B. Guest

    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

    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?

    Shawn B., Sep 8, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.