Example link
<div style="float:right;"><a href="<%= Url.Content("~/Home/List") %>" class="button"><span>Return to List</span></a></div>
I want to be able to attach an Id onto the end of the url which is from my Model like shown below in one of my many attempts
<div style="float:right;">(string.Format(<a href=\"{0}\{1}" %>, <% Url.Content("~/Test/Edit")%>, <% Model.Test.ID %>) "class="button"><span>Edit</span></a></div>
I know how to do it with action links but I want to keep to the same format and produce a button.
I know this works
<%: Html.ActionLink("Edit", "Edit", new { Id = Model.Test.ID }) %>
So anybody got as ideas for a solution?
Thx.
should do it, although you could use
Url.ActionhereThe main benefit of using
Url.Actionis that you have not tied yourself to any particular URL routing scheme, but to the controllers and action methods, thereby allowing you to change the routing when and how you please.