开发者

Designer.cs Errors

I'm very new to ASP.net, and I had to fix a issue in and ascx file (It was just an html fix). When I got ready 开发者_StackOverflowto put the code back into the repository I checked the changes in the Designer.cs file. They don't seem to match up with the changes in the ascx file.

Ultimately where do I see the errors for designer files? Will I see them when I build? When I view the page?

Thanks.


That's an interesting question with multiple scenarios. Assuming in your markup you have <asp:Label ID="Label2" but in Designer.cs you have protected global::System.Web.UI.WebControls.Label Label1;:

Scenario #1

You do not access Label1 or Label2 anywhere else.

No errors will happen.

Scenario #2

You set Label1.Text = "Test" in the code-behind file, or you set some control attribute to Label1 (such as

You get a runtime exception.

Scenario #3

You set Label2.Text = "Test" in the code-behind file.

You get a build error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜