Hi NG,
Is it possible in any way to serve an ASP.NET server control when the
request is beeing processed by a custom request handler?
In my case I use my own request handler to serve elements that exists as
content in a database, and not as files in the file system. What i want is
to be able to place ASP.NET controls on some of my output, so they can be
served alongside my requested content.
I've tried to create a System.Web.UI.Page instance, add a HtmlForm to its
Controls collection and my ASP.NET control to the HtmlForm. Calling the
Control or Page RenderControl() method provided me with the initial output
of the control, but it seams i need to do a little more work than that.
The Viewstate isn't maintained and the serverside events generated by the
control cannot be caught.
Do I need to manually parse the request for viewstate and serverside events?
Is there a way to do this easily? Or do I end up making my own version of
the ASP.NET RequestHandler?
Could anyone point me in the right direction?
Thanks for your time,
Ricky"Ricky K. Rasmussen" <morten@.mvponline.dk> wrote in message
news:eyNw%236HTEHA.332@.TK2MSFTNGP11.phx.gbl...
> Hi NG,
> Is it possible in any way to serve an ASP.NET server control when the
> request is beeing processed by a custom request handler?
> In my case I use my own request handler to serve elements that exists as
> content in a database, and not as files in the file system. What i want is
> to be able to place ASP.NET controls on some of my output, so they can be
> served alongside my requested content.
> I've tried to create a System.Web.UI.Page instance, add a HtmlForm to its
> Controls collection and my ASP.NET control to the HtmlForm. Calling the
> Control or Page RenderControl() method provided me with the initial output
> of the control, but it seams i need to do a little more work than that.
> The Viewstate isn't maintained and the serverside events generated by the
> control cannot be caught.
> Do I need to manually parse the request for viewstate and serverside
events?
> Is there a way to do this easily? Or do I end up making my own version of
> the ASP.NET RequestHandler?
> Could anyone point me in the right direction?
If your handler is able to derive from System.Web.UI.Page, then it will _be_
a page, and everything should work.
--
John Saunders
johnwsaundersiii at hotmail
Thanks for your reply John.
I know that deriving from the System.Web.UI.Page creates a ASP.NET Page that
can be served throug the ASP.NET RequestHandler. But what I want to do is to
serve an ASP.NET WebControl throug my own RequestHandler.
I figure this means that I need to programatically create a
System.Web.UI.Page with a HtmlForm containing my control, and then serve the
Page... but how do I do this?
Calling Page.RenderControl() does only create the initial output and doesn't
parse the request for server events and viewstate. Is there a way for me to
make the Page work as if it was served through the ASP.NET RequestHandler?
Thank you for your time,
Ricky
"John Saunders" <johnwsaundersiii@.notcoldmail.com> wrote in message
news:u19k0WITEHA.1544@.TK2MSFTNGP09.phx.gbl...
> If your handler is able to derive from System.Web.UI.Page, then it will
_be_
> a page, and everything should work.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
"Ricky K. Rasmussen" <morten@.mvponline.dk> wrote in message
news:uyrRW9ITEHA.1232@.TK2MSFTNGP09.phx.gbl...
> Thanks for your reply John.
> I know that deriving from the System.Web.UI.Page creates a ASP.NET Page
that
> can be served throug the ASP.NET RequestHandler. But what I want to do is
to
> serve an ASP.NET WebControl throug my own RequestHandler.
> I figure this means that I need to programatically create a
> System.Web.UI.Page with a HtmlForm containing my control, and then serve
the
> Page... but how do I do this?
> Calling Page.RenderControl() does only create the initial output and
doesn't
> parse the request for server events and viewstate. Is there a way for me
to
> make the Page work as if it was served through the ASP.NET RequestHandler?
No, I meant that your HttpHandler should _be_ a page:
public class MyRequestHandler : System.Web.UI.Page
{
...
}
John Saunders
johnwsaundersiii at hotmail
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment