I am getting this error

"Both DataSource and DataSourceID are defined on 'DataListCity'. Remove one definition."

This is the code from my Masterpage that is causing the error

<asp:DataList ID="DataListCity" runat="server" Width="100%" 
    onitemcommand="DataListCity_ItemCommand" CellPadding="4" 
    ForeColor="#333333" DataSourceID="SqlDataSource1">

        <asp:Label ID="CityIdLabel" runat="server" Text='<%# Eval("CityId") %/>
        <br />
        <asp:Label ID="CityNameLabel" runat="server" Text='<%# Eval("CityName")%>' />
        <br />
        <br />

    ConnectionString="<%$ ConnectionStrings:HotelConnString %>" 
    ID="SqlDataSource1" runat="server"   
    SelectCommand="SELECT [CityId], [CityName], [Description] FROM [Categories]">

Related posts

Recent Viewed