Where is the source code for Html.TextBoxFor

I am currently browsing the source code for asp.net mvc 3 I just downloaded from codeplex. I am particularly interested in seeing the source code for strongly typed Helper methods such as TextBoxFor and DropDownListFor, but I could not find them in InputExtensions.cs and elsewhere.

Will someone point out where I can find the required code? My goal is to see how these helper methods add the Html 5 data- * attributes to the various input elements of the form.

+6
source share
2 answers

Get a reflector (the version should be available somewhere for free), open System.Web.Mvc.dll and search for InputExtensions

or

Get mvc source code , open in visual studio and search for InputExtensions

edit: wrong to ask a question ..

I think you are looking for InputExtensions.cs line: 371

 tagBuilder.MergeAttributes(htmlHelper.GetUnobtrusiveValidationAttributes(name, metadata)); 
+6
source

You do not need to download source code or use reflector extensions.

If you “move on to definition” ( F12 ), you should see file metadata representing generic method declarations. From there, hover over the tab and you will see the path to the local file, where the method came from, which also corresponds to the namespace. With this, you can find it from the MVC source code on Codeplex:

http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/5cb74eb3b2f3#src/ System.Web.Mvc / Html / InputExtensions . CS

+11
source

Source: https://habr.com/ru/post/887804/


All Articles