Another question about the build your own ASP.NET 4 website

I have a quick question about this code from chapter 10. I get a warning message in the error window.

<asp:dataList id=“employeesList” runat=“server”
<asp:Literal ID=“extraDetailsLiteral” runat=“server”
EnableViewState=“false” />
Name: <strong><%#Eval(“Name”)%></strong><br />
Username: <strong><%#Eval(“Username”)%></strong><br />
<asp:LinkButton ID=“detailsButton” runat=“server”
Text=<%#"View more details about " + Eval(“Name”)%>
CommandArgument=<%#Eval(“EmployeeID”)%> />
<asp:LinkButton ID=“editButton” runat=“server”
Text=<%#"Edit employee " + Eval(“Name”)%>
CommandArgument=<%#Eval(“EmployeeID”)%> />
Name: <asp:TextBox ID=“nameTextBox” runat=“server”
Text=<%#Eval(“Name”)%> /><br />
Username: <asp:TextBox ID=“usernameTextBox” runat=“server”
Text=<%#Eval(“Username”)%> /><br />
<asp:LinkButton ID=“updateButton” runat=“server”
Text=“Update Item” CommandName=“UpdateItem”
CommandArgument=<%#Eval(“EmployeeID”)%> />
<asp:LinkButton ID=“cancelButton” runat=“server”
Text=“Cancel Editing” CommandName=“CancelEditing”
CommandArgument=<%#Eval(“EmployeeID”)%> />

The code in bold has a green squiggly line under it and I get the following warnings

“Validation (ASP:NET): Attribute values must be enclosed in quotation marks”

Now the code works just fine, but is this an example of a work around or non standard approach, or is it just that the debugger does not know how to handle this type of use?

also the “<asp:dataList id” in this code, the “D” in data is Capitalized but if I use : with a capital D in this post i get :smiley: for exaple <asp:DataList id LOL

Coding standards require attributes to be enclosed in quotation marks, that is why VS outputs warnings. Though those warnings are not errors, and the code is workable.

The trick to avoid these is to use different types of quotes – single quotes are valid in HTML. If you view source of alot of web forms sites they have all the attributes in single quotes for this reason.