locked
Combine Custom Server Control with HttpHandler RRS feed

  • Question

  • User-1952463932 posted

    You can't get there from here!

    At least that's what I seem to be reading given what I want to do.  But that doesn't seem right because the base components do what I want to do and so I would think that I should be able to do it the same way that they do.  Suppose I wanted to create my own Image server control.  I could add a new server control to my project and add a text property called ImageUrl.  That's easy enough.  But now when I override RenderContents I only have HtmlTextWriter and not the context.  On the other hand if I create a HttpHandler its very easy to get the context but then I can simply drag and drop the handler onto my aspx page.  Of course the regular Image control does exactly this.  So my question is how does it do it, and how can I duplicate it.

     

    Thanks in advance.

     

    Monday, November 16, 2009 1:36 AM

Answers

  • User-2106054853 posted

     Hi,

    Do you mean HttpContext? Why you cannot get it via HttpContext.Current?

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 17, 2009 2:11 AM

All replies

  • User-839561808 posted

    Have you tried registering the httphandler in your web.config?

    Monday, November 16, 2009 3:03 AM
  • User-1952463932 posted

    I haven't got that far.  As I said I really want a control but a control.  I just want to be able to get to the context so that I can output what I need to output which in my case is binary, rather than only text. 

    Tuesday, November 17, 2009 1:00 AM
  • User-2106054853 posted

     Hi,

    Do you mean HttpContext? Why you cannot get it via HttpContext.Current?

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 17, 2009 2:11 AM