Download file of any type in Asp.Net MVC using FileResult?
You can just specify the generic octet-stream MIME type:
You can just specify the generic octet-stream MIME type:
Get the form, ask for the action attribute:
The following is the correct overload (in your example you are missing a closing } to the routeValues anonymous object so your code will throw an exception): Assuming you are using the default routes this should generate the following markup: which will successfully invoke the GetByList controller action passing the two parameters:
The way I’ve seen this trick used is to put history.forward() on every page before the page where you don’t want the back button to work, then every time the user hits the back button it forwards them back to where they were. The common use is to prevent others from returning to a page (usually in … Read more