What is the difference between binding data in data grid view methods ??

Posted by Ashish on Stack Overflow See other posts from Stack Overflow or by Ashish
Published on 2011-01-03T05:46:47Z Indexed on 2011/01/03 5:53 UTC
Read the original article Hit count: 189

Filed under:

What is the difference between binding data in data grid view methods ??

 <ItemTemplate>
    <asp:LinkButton ID="lnkBtnUserName" runat="server" 
   Text='<%# DataBinder.Eval(Container.DataItem,"UserFirstName")%>'
                                            CommandArgument='<%# Eval("UserID") %>' OnClick="lnkBtnUserName_Click" />
                                    </ItemTemplate>

and this second one

 <asp:TemplateField HeaderText="Employee ID">
      <ItemTemplate>
          <asp:Label ID="lblempid" runat="server" Text='<%# Bind("EmpId.EmpId") %>'></asp:Label>
      </ItemTemplate>
</asp:TemplateField>

means in

method 1

Text='<%# DataBinder.Eval(Container.DataItem,"UserFirstName")%>'
          CommandArgument='<%# Eval("UserID") %>' 

method 2

Text='<%# Bind("EmpId.EmpId")

also explain use one this CommandArgument='<%# Eval("UserID") in 1st one ????

© Stack Overflow or respective owner

Related posts about ASP.NET