Last post May 09, 2007 10:55 PM by Rex Lin - MSFT
May 08, 2007 07:58 AM|DEHAAS|LINK
I am currently experimenting a bit with ASP.NET 2.0, to find out what I am capable of doing.
I would like to incorporate an entire page into a DLL (not pre-compilation), so I can visit pages that do not physically exist (not for URLRewriting either).
So far I have added this to my web.config:
Where the Factory is a class I have created, inherited from System.Web.UI.PageHandlerFactory. Here I determine whether I should return the standard page-handler,
or if it is a page I want to create programmatically.
If it is a page that should be generated from my DLL, I return at custom handler. Here I am just returning some text/plain to verify that everything works as
it should – and it does!
I know System.Wb.UI.Page do extend the Generic Hander, so I should be able to inherit from this class (in my custom handler). My question now goes: How can I
make the best use of System.Web.UI.Page class to take care of viewstate etc., like in the 'normal' page-model.
I hope you guys have some great ideas
May 08, 2007 02:37 PM|Svante|LINK
May 09, 2007 06:51 AM|DEHAAS|LINK
I have tried to make a new class witch inherits from the Page-class. In the Load-event I tried to do this:
Dim lblTest as new Label
lblTest.Text = "Test"
Then I made my factory return this class. The browser then receives:
May 09, 2007 10:55 PM|Rex Lin - MSFT|LINK
Would you please show your codes about custom page and HttpHandler for debugging.