(1) Same variable name
Protected system. Web. UI. webcontrols. Label lbltitle; protected system. Web. UI. webcontrols. Label lbltitle;
(2)
Check whether the control on your ASPX page has the same name (case-insensitive) ID as the class variable in your Aspx. CS.
The details are as follows:
<Input name = "username" runat = "server" type = "text" id = "username">
In Aspx. CS code, Public String username = NULL;
Conflict! Modify the variable username2 in Aspx. CS and click OK.
This is because when you start it in Vs, the dev Web will distinguish between the control and the background code variables in case,
After being deployed to the IIS server, the server is case-insensitive, so the variable name is duplicated, resulting in an "ambiguous match" error.
(3)
Space ID conflict. Although vs detects and modifies conflicting IDS by itself, not all cases can be detected.
On my page, there is an upload control with ID = fileupload, and a div with ID = fileupload, which has the runat = server attribute. vs cannot detect any of them, therefore, an error occurs on IIS.