surekha
What are the different types of databinding in ASP.NET?
By surekha in ASP.NET on Jan 30 2007
  • Feb, 2007 10

    Different types of Databind in ASP.Net

    1.<%# Container.DataItem("expression") %>

    2.<%# DataBinder.Eval(Container.DataItem, "expression"[, "format"]) %>

    3.<%# Eval("expression") %>

    4.<%# Bind("expression"[, "format"]) %>

    As with the Eval method, the Bind method has two overloads, which means that it can be used with or without
    the "format" parameter. In fact, other than specifying the new method name, the Bind method is used just
    like the Eval method. To bind an attribute of a control to the CompanyName column, you use:

    Example:
    <%# Eval("Price", "Special Offer {0:C} for Today Only!") %>
    <%# Bind("CompanyName") %>
    <%# Bind("OrderDate", "{0:dddd d MMMM}") %>

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS