Reputation: 1211
It's not clear what the proper syntax should be, and i tried some examples already but with no luck, this is my current button code that working and i need it to stay as a button when clicked open the action in new window/ new tab
<input type="button" title="Read" value="@T("Account.DownloadableProducts.Read")" onclick="location.href='@Url.Action("GetDownload", "Download", new { orderItemId = Model.DownloadMappingIds[product.Id].guid })'" />
thanks
Upvotes: 0
Views: 8390
Reputation: 11
I have been struggling with this for a while, the solution was to, instead of target="_blank", you should use formtarget="_blank".
Thanks!
Upvotes: 1
Reputation: 114
you can do this using javascript function
<input type="button" value="MyButton" onclick="myfunction(this)"
data-myurl="@Url.Action("aa", "bb", new { id=@id})" />
<script>
function myfunction(e)
{
var url = $(e).data('myurl');
var popupWindow = window.open(url,title,'scrollbars=1,height=650,width=1050');
}
</script>
Upvotes: 5
Reputation: 1510
I'm struggling to read your question and code but to open new windows, the following code is used:
target = "_blank"
Is it possible to tidy your question up a bit and then I'll be able to assist you further.
Upvotes: 0