Search code examples
c#iisresthttphandlerashx

Requesting ashx Web Handler is showing dialog to download the ashx file?


I have created a Login.ashx Web Handler to authenticate user by using the following REST Request:

http://192.0.0.0/Pages/LoginPage.ashx?Username=anonymous&Password=123

when I wanted to test my handler, I opened a browser and pasted the link, dialog asked me if I want to save this file of ".ashx",

Any Guide or help would be greatly appreciated.


Solution

  • All was my fault in the response content type I was doing the following:

    was:

    context.Response.ContentType = "text/text";
    

    now:

    context.Response.ContentType = "text/xml";