VS2003 Turn VS2005 common problem solving

Source: Internet
Author: User
Tags add net

I've been using ASP.net for 3 years, just beginning with manual authoring, later using VS2003, and upgrading from. NET Framework 1.0 to 1.1, which has never been a problem.
During this time, due to the development of mobile applications, ready to transition from VS2003 to VS2005. Before I could see the difference between the two, I tried to convert the original VS2003 project into a VS2005 project. After the conversion, a large number of errors occurred, and many files were not directed into the VS2005 project. After careful study, I found that the Web control was referenced in my program. aspx file and declared public in the. cs file, but he asked for protected. Such as:
I declare as: public Label ctlmsg; (declaring public is a bad habit)

The correct should be: protected Label ctlmsg;
So at the moment of conversion, all the controls declared as public must be modified to protected and then converted, otherwise the file cannot be imported into the project.
The conversion succeeded when I modified all the controls declared as public to protected. I looked at the project in VS2003 and all the files were converted.
This thought can be used normally, I am happy to compile the program, and found that cannot compile through, made a lot of mistakes.


Error 1:validation (Internet Explorer 6): ............
Description: The HTML code of the Web page does not conform to the specification, such as: <table>[color= #ff0000]<form><tr></tr></form></table>
Resolution: Menu Tools => Options => Text Editor => HTML => Validation Cancel Show Errors


Error 2:error 1 Missing partial modifier on declaration of type ' Index '; Another partial declaration of this type exists D:\root\www.5xsoft.com\Index.aspx.cs-D:\root\www.5xsoft.com\
Description: The class to inherit from the Web page to add partial declaration
such as public class Index:System.Web.UI.Page
Resolved: Add partial such as public partial class Index:System.Web.UI.Page

Error 3:error 1 The type ' zsweb.article ' already contains a definition for ' ctltitle ' D:\root\www.5xsoft.com\Article.aspx.cs 2 0 http://localhost/www.5xsoft.com/
Description: In VS2003, you can use a Web control to declare it in. cs, but it cannot be declared by default in VS2005.
Workaround: Delete the Web control declaration in the. cs file. such as delete protected Label ctltitle;
Summary: In fact, here, I circled a circle, in the conversion of the current, directly delete the Web control declaration, there will be no error 3 appear.



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.