how to generate Html.ActionLink with icon

后端 未结 6 2174
故里飘歌
故里飘歌 2020-12-14 15:30

I\'m starting to learn ASP.NET MVC, and have a problem, how generate code with Html.ActionLink like this:



        
6条回答
  •  情深已故
    2020-12-14 15:42

    I wanted to add to SLaks answer.

    Using with what user2567619 wanted.

    
        
        
            Create
                    
    
    

    I think it's worth mentioning that @Url.Action can take it's parameters like this:

    @Url.Action(string actionName, string controllerName) 
    

    Whereas @Html.ActionLink can take it's parameters like this:

    @Html.ActionLink(string linkText, string actionName, string controllerName) 
    

    It may be pretty obvious, but I thought it was worth noting.

    Edit

    As Peck_conyon noted, for both @Url.Action and @Html.ActionLink, these are just one of the ten different overload methods.
    For documentation on UrlHelper.Action, look here.
    For documentation on LinkEtensions.ActionLink, look here.

提交回复
热议问题