A
Alex Nitulescu
Hi. I have a web.config which says that all files with the "axd" extension
should by a special handler.
The handler writes some stats to the "axd" page.
Public Class WhosOnHandler
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Implements System.Web.IHttpHandler.ProcessRequest
............
context.Response.Write("<table border=1 cellpadding=4 bgcolor=orange>")
context.Response.Write("<tr><td colspan=4 align=center>")
...........
Public ReadOnly Property IsReusable() As Boolean Implements
System.Web.IHttpHandler.IsReusable
Get
Return True
End Get
End Property
End Class
Note that there *is no* axd aspx page in my project ! Whenever a user
presses on a button named "Stats", the code executes
Response.Redirect("TestForm2.aspx") and the handler detects a call to an AXD
file and takes care of the rest, as above.
My problem is that this axd file looks pretty plain, only with
"context.Response.Write". I have some custom controls which I would like to
load to make this page look consistent with the other pages on this website.
So the question is: how do I programatically load my controls in this
situation? I only have the 'Context' object and I need to somehow get to the
'Page' object to be able to say Page.Controls.Add. In other words, how do I
obtain an instance of this page ?
Thank you.
Alex
should by a special handler.
The handler writes some stats to the "axd" page.
Public Class WhosOnHandler
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Implements System.Web.IHttpHandler.ProcessRequest
............
context.Response.Write("<table border=1 cellpadding=4 bgcolor=orange>")
context.Response.Write("<tr><td colspan=4 align=center>")
...........
Public ReadOnly Property IsReusable() As Boolean Implements
System.Web.IHttpHandler.IsReusable
Get
Return True
End Get
End Property
End Class
Note that there *is no* axd aspx page in my project ! Whenever a user
presses on a button named "Stats", the code executes
Response.Redirect("TestForm2.aspx") and the handler detects a call to an AXD
file and takes care of the rest, as above.
My problem is that this axd file looks pretty plain, only with
"context.Response.Write". I have some custom controls which I would like to
load to make this page look consistent with the other pages on this website.
So the question is: how do I programatically load my controls in this
situation? I only have the 'Context' object and I need to somehow get to the
'Page' object to be able to say Page.Controls.Add. In other words, how do I
obtain an instance of this page ?
Thank you.
Alex