Last post Nov 17, 2009 02:11 AM by Allen Chen – MSFT
Nov 16, 2009 01:36 AM|tdinpsp|LINK
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.
Nov 16, 2009 03:03 AM|midwinter|LINK
Have you tried registering the httphandler in your web.config?
Nov 17, 2009 01:00 AM|tdinpsp|LINK
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.
Nov 17, 2009 02:11 AM|Allen Chen – MSFT|LINK
Do you mean HttpContext? Why you cannot get it via HttpContext.Current?