When using mvc, using a strong view in the view does not work. Adding a namespace reference to the web. config file does not work. Solution: mvcweb. config

Source: Internet
Author: User

When using mvc, using a strong view in the view does not work. Adding a namespace reference to the web. config file does not work. Solution: mvcweb. config

This is the model code in the view:

@ Model t_user_info

This is the only code for the web. config configuration file:

<Namespaces> <add namespace = "System. web. mvc "/> <add namespace =" System. web. mvc. ajax "/> <add namespace =" System. web. mvc. html "/> <add namespace =" System. web. optimization "/> <add namespace =" System. web. routing "/> <add namespace =" CeramicMasterApp "/> <add namespace =" CeramicMasterApp. models "/> <! -- After adding 20160804, restart VS --> </namespaces>

In this way, you do not need to add the following code to each view that uses the model:

@ Using CeramicMasterApp. Models;

However, after adding a model, you need to restart vs. Otherwise, an error is reported because the model cannot be identified.

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.