How does ASP.Net MVC ActionLink work?

I am trying to write my own LightWeight MVC for .Net 2.0 using NHaml as a viewer.

In ASP.Net 3.5 MVC, the View file that we used to specify the link for the code snippet.

Html.ActionLink("Add Product","Add");

There is no function in MVC binary to match this call.

I just found:

(In the class System.Web.Mvc.Html.LinkExtensions)

public static string ActionLink(this System.Web.Mvc.HtmlHelper htmlHelper, 
   string linkText, string actionName)

There are more similar static classes such as FormExtensions, InputExtensionsetc.

How does ASP.NET MVC handle this? Does it generate dynamic code for Html.ActionLink?

+3
source share
2 answers

ActionLink - (, this ). , HtmlHelper, HtmlHelper.

Html HtmlHelper. , ActionLink.

ActionLink ( ) .

+5

code Codeplex? MVC Framwork , , .

0

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


All Articles