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.
.NET ProgrammingASP.NETC#

Avatar of undefined
Last Comment
pkbugudai

8/22/2022 - Mon
SOLUTION
binaryevo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
binaryevo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Your help has saved me hundreds of hours of internet surfing.
fblack61