I'm trying to download a file with an html.actionlink(text, action, controller, reoute values, htmlattributes)
I'm trying to pass the view model
and text from an <input type="text"
to the controller. But I'm having trouble passing the input text to the MVC controller. I'm using an actionlink
because I can't seem to download the file with post
How can I pass the Model values and the text input to the controller? This is the HTML
<body>
<div class="col-md-12 form-group centered">
<div class="col-md-4"></div>
<div class="col-md-4">
<label for="quoted">Quoted:</label>
<input type="text" class="form-control" style="width:300px" id="quoted">
</div>
<div class="col-md-4"></div>
</div>
<div class="col-md-12 text-center">
@Html.ActionLink("Download", "GeneratePoExportDocument", "HealthCareExport", new {model = Model, quoted = "text box input goes here" }, new { @class = "btn btn-default", id="download-btn" })
</div>
Are there other methods to download a file where I can pass in all the values?
</body>
Here is the controller
public FileResult GeneratePoExportDocument(MyModel model, string quoted)
{
//my model has all of the values
//quoted is null I don't know how to pass that in
}