views:

40

answers:

1

Hi All,

I am trying to call a File ActionResult via jQuery

$.get("/Home/DownloadAction")

and I can see that the method is being called but no prompt to download the file (no errors either)? Can someone please explain? Because if I make it

Html.ActionLink("Download", "DownloadAction")

it works as expected.

Thanks, rodchar

+2  A: 

you're trying to pull the data in the background using AJAX with the $.get() method. I think you probably want something more along the lines of...

document.location = "/Home/DownloadAction";

to get the behavior you're looking for.

theraccoonbear
Thanks for the help, rod.
rod