Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET Page derives the IHttphandler 1

Status
Not open for further replies.

cappmgr

Programmer
Jan 29, 2003
639
US
I am unclear why the System.Web.UI.Page class derives the IHttpHandler. There are two members in the Interface and they are not used not used by the Page Class (ProcessRequest and IsReusable). The IHttpHandler (Defines the contract that ASP.NET implements to synchronously process HTTP Web requests using custom HTTP handlers.) I say they are not used because in the Object Browser when you click on Page in the Objects Pane they are gray in the Objects Member Pane and intellisense does not show them. Am I way off the mark with this question.
Thank you,
Marty
 
Good Question

Here are a couple explainations.

I agree that ProcessRequest and IsReusable are not used. I used isdasm.exe to look at a asp.net compiled page just before it is rendered to the browser (not a project compiled) and they weren't there.

"Not coincidentally, the Page class implements IHttpHandler, thereby indicating that it suffices as an HTTP handler. What the PageHandlerFactory does, then, is check to see if a compiled version of the requested ASP.NET Web page's class exists. If not, it dynamically creates this class and compiles it. This class, then, has a particular method invoked which generates the page's complete HTML markup. It's this HTML markup that is then returned to the client.
 
I used a reflector and looked at the page class. It does have a definition for ProcessRequest

Look at this attribute. This must hide this from you
[EditorBrowsable(EditorBrowsableState.Never)]

private void ProcessRequest()
{
Thread thread1 = Thread.CurrentThread;
CultureInfo info1 = thread1.CurrentCulture;
CultureInfo info2 = thread1.CurrentUICulture;
this.FrameworkInitialize();
try
{
try
{
if (this.IsTransacted)
{
this.ProcessRequestTransacted();
}
else
{
this.ProcessRequestMain();
}
this.ProcessRequestEndTrace();
}
finally
{
this.ProcessRequestCleanup();
InternalSecurityPermissions.ControlThread.Assert();
thread1.CurrentCulture = info1;
thread1.CurrentUICulture = info2;
}
}
catch
{
throw;
}
}



[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public bool IsReusable
{
get
{
return false;
}
}
 
stsuing,
I have much to learn. Thank you.
Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top