I’m working on a Nopcommerce, and need to generate Invoice (custom made not as what they already provide, because it just doesn’t solve our purpose). We need to generate Invoice
in new tab(using another cshtml file) using Controller’s method also I’m passing model data on view.
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.ProbableDeliveryDate):
</td>
<td class="adminData">
@Html.EditorFor(model=>model.ProbableDeliveryDate)
</td>
</tr>
<tr>
<td>
@if(Model.CanGenrateInvoice)
{
<input type="submit" name="generateinvoice" value="@T("Admin.Orders.Fields.generateinvoice")" id="generateinvoice" class="adminButton" />
}
</td>
</tr>
I’ve to post data to get value of probableDeliveryDate to controller method and after that want to open view in new tab.
How can i do this?
If you are getting to the action from the first page via an Html.ActionLink you can do this:
Specifying target = “_blank” will open in the new tab
Update
Since you are posting the model to the controller (I was hoping RedirectToAction could help open a new window/tab but that doesn’t look to be the case)
My spidy sense is tingling on the flow you have tho… This is just me but I would do something a little different.. such as
Your view could have a piece of razor code that did that: