Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 12453 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > purpose of handler (.ashx) in asp.net... ...
Gopal_nivas

purpose of handler (.ashx) in asp.net...

Replies: 6 | Posted by: Gopal_nivas on 8/17/2009 | Category: ASP.NET Forums | Views: 28507 | Status: [Member]  


hi..

what is the purpose of handler file(.ashx) in asp.net..

explain with examples..

need ur suggestions...

regards

gopal.s


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Raja
Raja  
Posted on: 8/17/2009 10:49:20 AM
Level: Starter | Status: [Member]

Please go through following link and you will get all required details with an example.

http://dotnetperls.com/ashx-handler

Thanks

Regards,
Raja, USA

Gopal_nivas, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Rtpharry
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 

Santosh.impossible
Santosh.impossible  
Posted on: 9/21/2010 2:45:07 AM
Level: Starter | Status: [Member] | Points: 25

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 

Lakshmanan.t
Lakshmanan.t  
Posted on: 1/9/2011 6:15:28 AM
Level: Starter | Status: [Member] | Points: 25

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
Karthikanbarasan  
Posted on: 1/9/2011 10:46:17 AM
Level: Silver | Status: [Member] [Moderator] [Microsoft_MVP] [MVP] | Points: 25

Hi,

Go through the below link... it explains the handlers in asp.net in detail

http://www.c-sharpcorner.com/uploadfile/civa_kumar2000/httphandlersinasp.net11282005003115am/httphandlersinasp.net.aspx

Thanks
Karthik
www.f5Debug.net

Gopal_nivas, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Chiragkanzariya
Chiragkanzariya  
Posted on: 10/16/2012 6:36:04 AM
Level: Starter | Status: [Member] | Points: 25

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 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 8:11:08 AM