Link to home
Start Free TrialLog in
Avatar of KaranGupta
KaranGupta

asked on

Bind and Eval query

Hi

I have read the difference between the Eval and Bind.

Eval - One way binding

Bind - Two Way binding

<asp:GridView ID="GridView2" runat="server"> 
        <Columns> 
            <asp:TemplateField> 
                <ItemTemplate> 
                    <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("name") %>'></asp:TextBox> 
                </ItemTemplate> 
            </asp:TemplateField> 
        </Columns> 
</asp:GridView>

Open in new window


And

<asp:GridView ID="GridView2" runat="server"> 
        <Columns> 
            <asp:TemplateField> 
                <ItemTemplate> 
                    <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("name") %>'></asp:TextBox> 
                </ItemTemplate> 
            </asp:TemplateField> 
        </Columns> 
    </asp:GridView>

Open in new window


gives the same result. Then how does these 2 things differ.
SOLUTION
Avatar of binaryevo
binaryevo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial