I am new to asp.net mvc. I have a button on my page. On click of that button I want to show download dialog box only. I don't want to call any other view and controller. Whenever I use @Html.BeginForm("Index", "Download", FormMethod.Post), it opens new window along with download dialog box. I don't want to open any new window. My code is as follows
@Html.BeginForm("Index", "Download", FormMethod.Post)
{
@{if (check.CheckName != "Total")
{
<td colspan="2" align="right">
<span class="button">
<input type="submit" value="View Report" class="form_button" onclick="window.showModalDialog('/Download/[email protected]&[email protected]','Download View','dialogHeight:4px;dialogWidth:4px;');" /></span>
</td>
<td colspan="2" align="left">
<span class="button">
<input type="submit" value="Download Report" class="form_button" /></span>
</td>
}
}
Is there any way to do this ?