开发者

File download with Jquery Mobile and ASP.NET MVC 3 Razor

I have a page in my website that requires a simple file download link. This link is implemented via the combination of an action link and a File ActionResult like so:

View Code:

@Html.ActionLink("Download", "Download", new { id = 1 }, new { @data_role = "button" }) 

Controller Code:

public ActionResult Download(int? id)
{
  ..
  ..
  return File(fileStream, fileInfo.Extension, fileInfo.Name);
}

This works fine without Jquery Mobile applied, but when I swit开发者_StackOverflow中文版ch on Jquery mobile the page freezes up after the action method returns from my controller.

Do I need to do something special with Jquery mobile for this to work correctly?


I think you might need to turn off the ajax loading for that link. There are a couple of ways to do it, adding rel="external" being one of them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜