I’m using a Html.BeginForm but I need a hyperlink to trigger a postback to a ActionResult (similar functionality to a LinkButton). I don’t think that I can use an ActionLink because i’m not routing to a view with the same name as the ActionResult (or have I misunderstood :S).
Any help would be appreciated.
Thanks
I think you have two options (though the first isn’t as flexible and can get messy)
1) style your submit button like a hyperlink (easy, but you’ll probably end up using
Html.BeginAjaxor something like that)2) Style a div, ActionLink, or some other element and serialize the form data on posting back using jQuery
If you can better describe the data being returned, we can better customize the
dataTypeandsuccessparameters below.Edit
So, you’re controller could look like
And you’d need to modify the
successfunction above to something like