Questions about. Net MVC

Source: Internet
Author: User

I encountered the following problems when I was a beginner at MVC. I am posting them to share with you!

I. How to debug the MVC Program

1) modify the web. config, in the web. <add Assembly = "system. web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>, delete or comment out this line <! -- <Add Assembly = "system. Web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"/> -->

2) The web. pageparserfiltertype = "system. web. MVC. viewtypeparserfilter, system. web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "changed to pageparserfiltertype =" system. web. MVC. viewtypeparserfilter, system. web. MVC, version = 2.0.0.0, culture = neutral, publickeytoken = NULL"

3) download source code, Source Code address: http://www.microsoft.com/downloads/details.aspx? Familyid = c9ba1fe1-3ba8-439a-9e21-def90a8615a9 & displaylang = en

4) Compile the source code to generate relevant dynamic libraries.

5) remove system. Web. MVC references from the MVC project.

6) Add the system. Web. MVC dynamic library generated by compiling source code in the MVC project.

7) debug the program and learn about MVC. Everything is OK.

2. Deploy the MVC program on IIS 5.1

1) create a virtual directory for the MVC Project

2) Click Properties> virtual directory> configuration options.

3) Add the extension. * ing file. The executable file path is C:/Windows/Microsoft. net/framework/v2.0.50727/aspnet_isapi.dll, select the check box before "Script Engine", and remove the check box before "check whether a file exists.

4) deployment is complete!

Added the suffix of the Three-character MVC program: .html or. sthml.

1) Find the global. asax file in the project.

2) find routes. maproute (
"Default", // route name
"{Controller}/{action}/{ID}", // URL with Parameters
New {controller = "home", Action = "Index", id = ""} // parameter defaults
);

3) change to: routes. maproute (
"Default", // route name
"{Controller}/{action}. Html/{ID} ", // URL with Parameters
New {controller = "home", Action = "Index", id = ""} // parameter defaults
);

Bold in red.

4. If there are multiple tokens, modify them once again, and add .html after the specified actiontag.

5) test, you can see that all your web pages are suffixed with. html.

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.