I have a simple question.
I have the following html code
<a href="#" class="purchase">
<span>Purchase</span><em>@string.Format("{0:C0}", Model.thisItem.ItemSalePrice)</em>
</a>
But I want to use a Ajax.Actionlink to make it as a ajax post.
I have the following updated code
@Ajax.ActionLink("Purchase", "AddToCart", "Browse", new { ItemID = Model.thisItem.ItemID }, new AjaxOptions { UpdateTargetId = "content" }, new { @class = "purchase" })
The question is how I can put the tag into the actionlink?
Thank you everyone.
UPDATES
I also got an answer from ASP.NET’s forum, and it is even easier.
http://forums.asp.net/p/1702210/4518688.aspx/1?p=True&t=634468566867949718
Just specify it in the action link text parameter:
EDIT 1:
Other overloads are not shown, but this should be enough to get you started.
If you need more details, you can take a look at the MVC3 source and see how they setup their helpers.
Note:
HtmlHelper.AnonymousObjectToHtmlAttributesis under theSystem.Web.Mvcnamespace.