Use @functions then create inside of the @functions
I give just samll sample code.
Working process for when razor view in @Htmllable run time call the GetSomeString() methode. This method return just concatenation in tow string value.
So we can asign any method in Razor view
@functions{
public string GetSomeString()
{
return MakeMeChangeMyJob.Strings.Resume.PadRight(100) + " (min 100 characters )";//Add space and some tect
}
}
@Html.Label(GetSomeString(), new { @class = Model.AccountType == MakeMeChangeMyJob.Models.AccountType.User ?
"required" : "none" })
So we can asign any method in Razor view.More details is below
http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx
http://dotnetslackers.com/articles/aspnet/Razor-Functions-and-Helpers.aspx
No comments:
Post a Comment
If any doubt?then please comment in my post