Updated content of ASP. net mvc 3 RC2

Source: Internet
Author: User

Http://www.microsoft.com/web/gallery/install.aspx? Appid = mvc3

1. htmlencode of razor

By default, our razor output will undergo htmlencode encoding.

For example

 
1:@{

 
2:VaR html ="<P> text </P>";

 
3:}

 
4:@ Html

In fact, the output content is the encoded HTML

Previously we solved this problem by converting the text into ihtmlstring:

 
1:@{

2:VaR html =NewHtmlstring ("<P> text </P>");

 
3:}

 
4:@{

 
5:VaR html = mvchtmlstring. Create ("<P> text </P>");

 
6:}

One of the two methods can directly output htmlCodeIn ASP. net mvc 3 RC2, an htmlhelper method raw is added to directly output unencoded HTML:

1:@{

 
2:VaR html ="<P> text </P>";

 
3:}

 
4:@ Html. Raw (HTML)

 

2. Some other naming changes:

Change controller. viewmodel and viewpage. View to viewbag.

Change controllersessionstateattribute to sessionstateattribute.

Change the fields attribute in remoteattribute to additionalfields.

Change the skiprequestvalidationattribute class to allowhtmlattribute.

3. jquery Integration

ASP. net mvc 3 RC2 integrates jquery 1.44, jquery validation 1.7, and jquery UI 1.86

4. fixed the problem that blank lines will automatically appear before the razor syntax uses @ model.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.