I am lookng for LabelFor extension method source code in 开发者_JAVA百科MVC 3 Project. Can someone tell me where is it ?
I do not think you will find this source code.
Here is an interesting blog post that explains how you can create your own LabelFor extension, accepting an additional parameter. This may yield some insight into how LabelFor works. ASP.NET MVC LabelFor Helper With HtmlAttributes
The default helpers are very extensible. If your objective is to change the way the data is rendered, you may want to look into creating Templated Helpers. Which allow your dramatic control over how your model is rendered.
The source code for MVC 3 has not been released yet.
However the source for this extension method is in the LabelExtensions.cs
file.
The latest version (MVC4) can be found at : http://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Mvc/Html/LabelExtensions.cs
精彩评论