【问题标题】:Requesting ashx Web Handler is showing dialog to download the ashx file?请求 ashx Web 处理程序正在显示下载 ashx 文件的对话框?
【发布时间】:2011-03-20 09:43:54
【问题描述】:

我创建了一个 Login.ashx Web 处理程序来使用以下 REST 请求对用户进行身份验证:

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

当我想测试我的处理程序时,我打开了一个浏览器并粘贴了链接,对话框询问我是否要保存这个“.ashx”文件,

任何指南或帮助将不胜感激。

【问题讨论】:

    标签: c# iis rest httphandler ashx


    【解决方案1】:

    响应内容类型都是我的错,我正在执行以下操作:

    曾经:

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

    现在:

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

    【讨论】:

      猜你喜欢
      • 2011-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-02
      • 1970-01-01
      • 1970-01-01
      • 2012-11-14
      • 1970-01-01
      相关资源
      最近更新 更多