Last post Sep 05, 2007 08:32 PM by ddjs
Member
1 Points
7 Posts
Aug 27, 2007 07:52 PM|ddjs|LINK
Is it possible to create custom server controls on the fly?
I need a way to programatically output a control before the request handler finishes executing.
Preferably in a HttpModule or HttpHandler as I don't have direct access to any Pages.
Any ideas/help greatly appreciated.
Participant
1471 Points
442 Posts
ASPInsiders
MVP
Aug 28, 2007 04:18 AM|rstrahl|LINK
Not really. You need to be within the context of a Page in order to add anything to it. Which means you have to use a handler subclassed from Page.
Sep 05, 2007 07:42 PM|ddjs|LINK
Scott Guthrie wrote about a method to programmatically inject the output of user controls outside of a Page.
Not a server control, but just about if not more useful.
Here's the link:
http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx
Contributor
2843 Points
524 Posts
Sep 05, 2007 07:46 PM|pbromberg|LINK
I'm reading the other responses to your post and it becomes clear that you need to provide more specific context about exactly what you need to do . This could be done with "pseudocode" just to show the flow of what you expect to be able to do.
Sep 05, 2007 08:32 PM|ddjs|LINK
Yeah my bad. The original need was to be able to use embedded resources inside a IHttpModule or IHttpHandler.
I wasn't aware that you could just instantiate Pages and access the ScriptManager.
Didn't mean to be unclear.
Member
1 Points
7 Posts
Creating server controls on the fly
Aug 27, 2007 07:52 PM|ddjs|LINK
Is it possible to create custom server controls on the fly?
I need a way to programatically output a control before the request handler finishes executing.
Preferably in a HttpModule or HttpHandler as I don't have direct access to any Pages.
Any ideas/help greatly appreciated.
Participant
1471 Points
442 Posts
ASPInsiders
MVP
Re: Creating server controls on the fly
Aug 28, 2007 04:18 AM|rstrahl|LINK
Not really. You need to be within the context of a Page in order to add anything to it. Which means you have to use a handler subclassed from Page.
West Wind Technologies
Making waves on the Web
weblog.west-wind.com
Check out: Markdown Monster
Member
1 Points
7 Posts
Re: Creating server controls on the fly
Sep 05, 2007 07:42 PM|ddjs|LINK
Scott Guthrie wrote about a method to programmatically inject the output of user controls outside of a Page.
Not a server control, but just about if not more useful.
Here's the link:
http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx
Contributor
2843 Points
524 Posts
Re: Creating server controls on the fly
Sep 05, 2007 07:46 PM|pbromberg|LINK
I'm reading the other responses to your post and it becomes clear that you need to provide more specific context about exactly what you need to do . This could be done with "pseudocode" just to show the flow of what you expect to be able to do.
<a href="http://peterbromberg.net>PeterBromberg.net
Member
1 Points
7 Posts
Re: Creating server controls on the fly
Sep 05, 2007 08:32 PM|ddjs|LINK
Yeah my bad. The original need was to be able to use embedded resources inside a IHttpModule or IHttpHandler.
I wasn't aware that you could just instantiate Pages and access the ScriptManager.
Didn't mean to be unclear.