How to Bind DropDownlist in c#.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • usmnaaan
    New Member
    • Feb 2013
    • 1

    How to Bind DropDownlist in c#.net

    Code:
    <asp:TemplateField HeaderText="Group_Id"> <ItemTemplate> <asp:Label ID="G1" runat="server" Text='<%# Eval("Group_Id") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="G2" runat="server" Text='<%# Eval("Group_Id") %>'></asp:TextBox> </EditItemTemplate> <FooterTemplate> <asp:DropDownList ID="G3" runat="server" AutoPostBack="True" 
                                        onSelectedIndexChanged=" Group_Item_Name_SelectedIndexChanged" Width="133px"> </asp:DropDownList> </FooterTemplate> </asp:TemplateField>
    on running i find this error

    Compiler Error Message: CS1061: 'ASP.webform12_ aspx' does not contain a definition for 'Group_Item_Nam e_SelectedIndex Changed' and no extension method 'Group_Item_Nam e_SelectedIndex Changed' accepting a first argument of type 'ASP.webform12_ aspx' could be found (are you missing a using directive or an assembly reference?)

    Source Error:



    Line 143: </EditItemTemplat e>
    Line 144: <FooterTemplate >
    Line 145: DropDownList ID="G3" runat="server" AutoPostBack="T rue"
    Line 146: onSelectedIndex Changed=" Group_Item_Name _SelectedIndexC hanged" Width="133px">
    Line 147:</asp:DropDownLis t>
    Last edited by Rabbit; Feb 16 '13, 11:35 PM. Reason: Please use code tags when posting code.
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    It's saying you dont have a method named Group_Item_Name _SelectedIndexC hanged. Do you?

    Comment

    Working...