Why is new showat attribute required when using code generation?

Posted by Patrick Karcher on Stack Overflow See other posts from Stack Overflow or by Patrick Karcher
Published on 2010-04-01T16:31:06Z Indexed on 2010/04/01 16:33 UTC
Read the original article Hit count: 208

Filed under:
|
|
|
|

When I generate code using T4 templates in Visual Studio 2010, I get the following error for each of my asp controls when I try to compile:

Control "ddState" is missing required attribute "showat".

I have never gotten this error in previous versions of .NET. Further, I don't get this error when I manually construct my pages either by dragging/dropping, nor do I get it when I type out the control text myself. When I generate code, I have to manually add showat="client" to my tag for the compiler to be happy. It was my understanding that I never had to explicitly specify this tag. The following:

<asp:dropdownlist id="ddState" runat="server" showat="client" />

solves the problem. Why do I have to add this to generated code but not other times?

(It's a VS-2010 webforms project, using VB, in case that makes a difference.)

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about ASP.NET