Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2009, 02:18 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default DataBinder.Eval(Container.DataItem, "Role")

hello friends!!

pls tell me wht is the difference between them, they all work same...

<%# DataBinder.Eval(Container.DataItem, "Role") %>
<%# Eval("Role") %> // TemplateControl
<%# Bind("Role") %>


waiting for reply..
thanks!!!
__________________
DPK..
 
Old March 30th, 2009, 03:00 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Nos. 1 and 2 are in fact the same. The shorter way of calling the Eval method was introduced in .NET 2.0.

No. 3 is different. Eval only allows one-way "read" operations, while Bind allows two-way "read" and "write." If you are only selecting records and binding them to a display (say, a Label), they appear to work the same. However, if you want to be able to update records and persist them back to the database (from say, a Textbox) you need to use Bind.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a files general property of "Type of file" GregSivers Visual Basic 2008 Essentials 7 June 3rd, 2009 09:38 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM
Chapter-5 on Intents:ContactPickerTester does not show the button "Pick a Contact" sunilm12 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 April 15th, 2009 11:55 AM
WebPart not supporting/enabled displaymode other than "Browse" amitjoshipune ASP.NET 2.0 Professional 1 January 9th, 2009 02:34 PM
DataBinder.Eval(Container, etc. - Please explain pete_m ASP.NET 1.0 and 1.1 Basics 1 June 25th, 2004 11:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.