Replies |
Raja
Posted on: 8/17/2009 10:49:20 AM
|
Level: Starter | Status: [Member]
|
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Rtpharry
Posted on: 8/21/2009 7:17:26 AM
|
Level: Bronze | Status: [Member] [MVP]
|
By far the most common example I point people to a File Handler.
This lets you store your files in a safe location and serve them up through a controlled environment.
Why would you want to do this? Well you might want to only allow the file owner or an authenticated user to get access.
In order to prevent name clashes with the files stored on the server you might need to rename such as adding a guid to give them a unique name. The file handler would let you serve up the file as if it had the original, clean name.
Now that I have gone on about file handlers for long enough I should show you my link that I roll out in situations like these:
http://blogs.msdn.com/petel/archive/2005/12/01/499189.aspx
This is just one use for an ashx. You can serve any combination of html, images, binary that you require.
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Follwing are some of uses of handler file(.ashx) in asp.net:
1. Apply security mechanism,
2. URL rewriting,
3. Filter something in the request that is send to IIS.
Please let me know if you know any more uses of .ashx file.
Thanks & Regards,
Santosh
santosh kumar patro
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
You want to create an ASP.NET file that is not a typical web forms page. Your file will need to dynamically return an image from a query string, or XML and other non-HTML web pages.
it's usually much more convenient to generate a simple handler than it is to create a whole new assembly to handle the request. Second, you don't need to run interference with either Web.Config or with IIS. That is, Web.Config and IIS already understand what to do about files with the extension of .ashx. Installing ASP.NET places those when mapping into IIS.
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Karthikanbarasan
Posted on: 1/9/2011 10:46:17 AM
|
Level: Silver | Status: [Member] [Moderator] [Microsoft_MVP] [MVP] | Points: 25
|
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
An ASHX handler allows you a discrete http handler without the overhead of processing a page request (an ASPX file).
For Example you can check my blog http://chiragkanzariya.blogspot.in/
Gopal_nivas, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|