Shaver Reference Documentation

This time, I will not say that I am new to the razor, because I have been coming here for quite a while, but I cannot avoid this feeling. Let me show you why I still feel this way. So here is my simplest question ever posted in my coding history.

Is there any help documentation from Microsoft for Razor? I can google quite a lot of all the other blogs out there [ie. all MS staff, blogging, all the cool stuff for a razor, I appreciate that already] but that's not what I'm looking for here. I need to know if there is a centralized place like msdn from microsoft for asp.net mvc3 RAZOR oriented only, especially related to front panel controls like SelectList etc. Or is he expelled from the micro-reset?

These are the closed things I've encountered. they tried their best to organize it, but it was still quite confused by the organized

http://msdn.microsoft.com/en-us/library/gg416514(VS.98).aspx

but I still find it very difficult to find basic level information as I have no experience with that.

or it looks like Mircosoft launched another graphical dev form before actually knowing what to do with its interface, or at least documenting it.

PS: Only answer if you understand this question.

+3


source to share


2 answers


First of all, here's a good tutorial:

http://msdn.microsoft.com/en-us/gg618477

Second, for the HtmlHelper (Html.SomeFunc) and UrlHelper (Url.SomeFunc) functions, check each one below:

HtmlHelper: http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper%28v=vs.98%29.aspx UrlHelper: http://msdn.microsoft.com/en-us /library/system.web.mvc.urlhelper%28v=vs.98%29.aspx

Third, you can use ASP.NET MVC3 code itself.

http://aspnet.codeplex.com/releases/view/58781



ASP.NET MVC3 is released under MS-PL, you can see what's going on under the hood and the above code provides unit tests. You can learn a lot from them.

For example, ActionLink functions are tested as follows:

[TestMethod]
public void ActionLink() {
    // Arrange
    HtmlHelper htmlHelper = MvcHelper.GetHtmlHelper();

    // Act
    MvcHtmlString html = htmlHelper.ActionLink("linktext", "newaction");

    // Assert
    Assert.AreEqual<string>(@"<a href=""" + AppPathModifier + @"/app/home/newaction"">linktext</a>", html.ToHtmlString());
}

      

You can see what's going on here.

Finally, you can use some books. I read "Pro ASP.NET MVC3 Framework" and this book helped me a lot. It doesn't give you step-by-step examples of every HtmlHelper extension method, but you can find the HTML that these methods generate.

+1


source


The best guide I've found:



http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx

+1


source







All Articles