Wednesday, April 16, 2008

ASHX File(web handler)

ASHX File(web handler) :


->ASHX file is a web handler file works just like an aspx file except you are one step back away from the messy browser level where HTML and C# mix.
->One reason you would write an .ashx file instead of an .aspx file is that your output is not going to a browser but to an xml-consuming client of some kind. Working with .ashx keeps you away from all the browser technology you don't need in this case. Notice that you have to include the IsReusable property.
->ashx file could have its qwn code-behind file.
->ashx files are webHandles that derive from IHTTPHandler.
->there is no requirement for registration in web.config or machine.config.
->.ashx is used to avoid manipulation web.config file (b’coz the ashx handler knows its purpose and correctly invoked the right handler).
->ashx contain code only without HTML.
->it implements the IHTTPHandler Interface and the two methods of “Process Request” & “IsReusable”.
->The “ProcessRequest” is your main method where you put your code.”
->The “IsReusable” method is set to true.

How to create:
Steps:
http://www.15seconds.com/issue/060406.htm

->this use for photo albums , Rss feeds & blogging sites.
->Each of these is a good example of work that can be better accomplished without standard HTML.
I have download some file that example of photoalbums.
->Through ashx file: RSS feeds returns information in correct formate.
http://www.aspcode.net/Creating-an-ASHX-handler-in-ASPNET.aspx

ashx file also used for the generation bar code online
see example:
http://community.bartdesmet.net/blogs/bart/archive/2006/09/19/4450.aspx

No comments: