View Single Post
  #6 (permalink)  
Old April 19th, 2008, 05:12 AM
VeganMan VeganMan is offline
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Imar
 Or:

<asp:DropDownList ID="drp" runat="server">
<asp:ListItem Text="foo" Value="foo" />
</asp:DropDownList> ...
Oh, sort of like the code automatically generated on page 400:

    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
        DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Id"
        AppendDataBoundItems="True">
        <asp:ListItem Value="">Please make a selection</asp:ListItem>
    </asp:DropDownList>

Which can be changed to:

    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
        DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Id"
        AppendDataBoundItems="True">
        <asp:ListItem Value="" Text="Please make a selection" />
    </asp:DropDownList>

If it's a better code, why isn't the program creating it that way?

Terry

Reply With Quote