Probably it should be very easy but I am not sure that I did it correctly, so I want to ask you how to convert the code below to T4MVC syntax:
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new {id = "loginLink"})
I tried to do this code and it works fine but I am not sure I did it 100% correct.
@Html.ActionLink("Log in", MVC.Account.Login(null, null), htmlAttributes: new { id = "loginLink" })
The Login method signature is:
public virtual async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
Thanks in advance.
Based on this example:
being transformed into this:
Your implementation of ActionLink using T4MVC seems correct.
You include your link text -
Log inYou include your Controller -
AccountYou include your Action Name/Method with parameters -
Login(null, null)The only thing that I can't find is the correct way to implement
htmlAttributesbut I was able to find this example. You might not even need to puthtmlAttributes: new { id = "loginLink" }.. instead just trynew { id = "loginLink" }and take out thehtmlAttributes.I hope this helps!