I’m trying to make a Html.Actionlink() that receive something and put it in a new tab, the problem is that the button is a input type.
I have the input like this,
<input type="submit" class="btnText" id="previewButton2" value="Preview" />
What I’m doing in the input do it in the ActionLink, but it’s not working and I don’t Know Why.@Html.ActionLink("Preview", "/", new { Id=Model.Id}, new { @class = "btnText", type = "submit", target = "_blank" })
How can I use the input tag in the ActionLink or what should I do that maybe work?
Your only option using your existing code would be to submit the form using Javascript onclick (but that isn’t really good practice)
What you should really do is style your
inputbutton so that it looks like youratag, then you can alleviate the need to use JavaScript to do what you need.