How to do it with razor helper method?
The answer at question linked below uses extension method.
Action Image MVC3 Razor
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not really sure why an extension method isn’t suitable, but something like this should work:
That is just off the top of my head, so your milage may vary. You should also be able to use the implementation provided in the question as a
@functions { }block rather than an extension method as well.