What are the benefits of an ASHX handler file in asp.net?

前端 未结 4 2043
甜味超标
甜味超标 2020-12-15 22:59

What are the benefits of using an ashx, or handler? Also, do I need them if I use MVC (and why not)?

Does the framework matter (2.0+)?

Why would I want to u

4条回答
  •  囚心锁ツ
    2020-12-15 23:44

    Just a few examples:

    1. Dynamic image generation: You can write handlers that return data driven images by creating an ASHX handler that returns image data and then using that URL in your tags. e.g. user's custom icon

    2. Returning REST-based XML or JSON data to AJAX code on the client.

    3. Custom HTML: Return totally custom HTML for a page when the ASP.NET Web Forms or MVC framework is too restrictive

    I believe this has been available since 1.0

提交回复
热议问题