473,382 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Differences between 2 tags

Hi,

What are the differences between

<%# Container.DataItem("CustomerID") %>
and
<%# Databinder.eval(Container.DataItem, "CustomerID") %>

I saw both of them used in a lot of sample codes.

TIA
Nov 18 '05 #1
2 865
They would both achieve the same result, but -

The first expression will only work if the language setting of the
page is "VB".

The second expression with DataBinder.Eval will work in either a
language = "VB" or a language = "C#" page.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 30 Nov 2004 09:05:03 -0800, "Ed Chiu"
<Ed****@discussions.microsoft.com> wrote:
Hi,

What are the differences between

<%# Container.DataItem("CustomerID") %>
and
<%# Databinder.eval(Container.DataItem, "CustomerID") %>

I saw both of them used in a lot of sample codes.

TIA


Nov 18 '05 #2
1) the first is a direct method call returning the default data type. the
<%#%> operator is expecting a string return value. in the case of c#, a
compile/runtime error will return if the method does not return a string.

2) the eval method uses reflection, to execute the method. it always returns
a string.

"Ed Chiu" <Ed****@discussions.microsoft.com> wrote in message
news:7D**********************************@microsof t.com...
| Hi,
|
| What are the differences between
|
| <%# Container.DataItem("CustomerID") %>
| and
| <%# Databinder.eval(Container.DataItem, "CustomerID") %>
|
| I saw both of them used in a lot of sample codes.
|
| TIA
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RedHat_79 | last post by:
Hello everybody, I have already found a fair bit of information regarding on this group however I wouldn't mind expanding that a bit if possible. :) I am at the moment weighing my options in...
1
by: Greg | last post by:
The following code works fine on Mozilla but generates an error* on IE, when the button calling the function is pressed and the slideshow is either on the first slide or last slide. * I can't...
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
9
by: Artist | last post by:
Mozilla and IE works different with Javascript. I have Javascript Code which works fine with Mozilla and it breaks with Internet Explorer. I like to convert my code to work with both the...
2
by: David Otton | last post by:
Hi, I'm seeing a difference in behaviour between window.onload = f(); and <body onload="f();"> Specifically, window.onload appears to fire before all the elements of the page have been...
16
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a...
7
by: Hoss | last post by:
Hello all- This is what im trying to achieve. At the top of my page there is some search functionality, through which you cause to be loaded a string representing an HTML page. Below this and...
3
by: Nik | last post by:
I have been trying base my site on the Ruthsarian Lab's layout at http://webhost.bridgew.edu/etribou/layouts/skidoo/demos/tweak_01.html This design is in xhtml, whereas I would prefer to have my...
3
by: timetaco | last post by:
Relatively new to Javascript, please be gentle... In Firefox 2, document.getElementById is returning an HTMLDivElement, in IE 7, it is returning an Object. For example: <div...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.