473,507 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataBinder question

In a DataList, I'm using the following:

<%# DataBinder.Eval(Container.DataItem, "characterization")%>

I was wondering if it's possible to create a string that would contain
the value of the above line, so that I can manipulate it:

I tried

string resultText = DataBinder.Eval(Container.DataItem, "characterization");

....but I get an error saying "Container" does not exist in the current
context.

Any advise on how to get the value of "characterization" into "resultText"?
Nov 22 '06 #1
3 1175
An easy way to manipulate it is to pass it to a function. You could put a
function in the code behind :
public string DoStringWord(string characterization){
return characterization; //Do something here
}

and in the page put:
<%# DoStringWord(DataBinder.Eval(Container.DataItem, "characterization")) %>
Give it a go.

Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com

"Kevin Blount" wrote:
In a DataList, I'm using the following:

<%# DataBinder.Eval(Container.DataItem, "characterization")%>

I was wondering if it's possible to create a string that would contain
the value of the above line, so that I can manipulate it:

I tried

string resultText = DataBinder.Eval(Container.DataItem, "characterization");

....but I get an error saying "Container" does not exist in the current
context.

Any advise on how to get the value of "characterization" into "resultText"?
Nov 22 '06 #2
Hi Ciaran,

I gave that a try, but had to make a small modification. The method
(DoStringWord) was expecting a string. Once I figured that out, and
added .ToString() at the end of the call, your script worked wonderfully!

<%# DoStringWord(DataBinder.Eval(Container.DataItem,
"characterization").ToString()) %>

Thanks for the reply and the answer :)

Kevin

Ciaran O''Donnell wrote:
An easy way to manipulate it is to pass it to a function. You could put a
function in the code behind :
public string DoStringWord(string characterization){
return characterization; //Do something here
}

and in the page put:
<%# DoStringWord(DataBinder.Eval(Container.DataItem, "characterization")) %>
Give it a go.

Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com

"Kevin Blount" wrote:
>In a DataList, I'm using the following:

<%# DataBinder.Eval(Container.DataItem, "characterization")%>

I was wondering if it's possible to create a string that would contain
the value of the above line, so that I can manipulate it:

I tried

string resultText = DataBinder.Eval(Container.DataItem, "characterization");

....but I get an error saying "Container" does not exist in the current
context.

Any advise on how to get the value of "characterization" into "resultText"?
Nov 22 '06 #3
Hi Ciaran,

I gave that a try, but had to make a small modification. The method
(DoStringWord) was expecting a string. Once I figured that out, and
added .ToString() at the end of the call, your script worked wonderfully!

<%# DoStringWord(DataBinder.Eval(Container.DataItem,
"characterization").ToString()) %>

Thanks for the reply and the answer :)

Kevin

Ciaran O''Donnell wrote:
An easy way to manipulate it is to pass it to a function. You could put a
function in the code behind :
public string DoStringWord(string characterization){
return characterization; //Do something here
}

and in the page put:
<%# DoStringWord(DataBinder.Eval(Container.DataItem, "characterization")) %>
Give it a go.

Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com

"Kevin Blount" wrote:
>In a DataList, I'm using the following:

<%# DataBinder.Eval(Container.DataItem, "characterization")%>

I was wondering if it's possible to create a string that would contain
the value of the above line, so that I can manipulate it:

I tried

string resultText = DataBinder.Eval(Container.DataItem, "characterization");

....but I get an error saying "Container" does not exist in the current
context.

Any advise on how to get the value of "characterization" into "resultText"?
Nov 22 '06 #4

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

Similar topics

0
3803
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval:...
2
2028
by: dm_dal | last post by:
I have a control on my webform that I am binding to a dataset. The issue is, the field value in the dataset is encrypted and I am trying to decrypt it during the binding process: Example: ...
1
1756
by: Chris | last post by:
Hey Okay using DataBinder.Eval in a repeater. My question is this - if the value is empy, eg the myDownloadFile is empty, how can i display different output than if it was populated. #...
2
1268
by: George Durzi | last post by:
Here's my asp:Repeater <asp:Repeater ID="rptHelpDeskSystemStatus" Runat="server"> <HeaderTemplate> <table width="100%" border="0" class="datatable"> <tr class="item"> </HeaderTemplate>...
4
1675
by: Pierre Shirvan | last post by:
I have a form with a DataList control with a label control and a text control in the ItemTemplate section. I can display the data in the text contol using the DataBinder.Eval method and I also want...
2
5409
by: Patrick Olurotimi Ige | last post by:
If have i a funtion below:- Protected Function CheckUnit(Units As Object) As String '----------------------------------------- ' If the Units returned equals to Zero, ' a message of "Out of...
3
2540
by: Mark Jones | last post by:
I am quite new to ASP and .Net development and I am building a web-based multiple choice exam application. The web page displays the questions using a Repeater control and the answers are nested...
4
7327
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever...
3
3384
by: Kevin Blount | last post by:
In a DataList, I'm using the following: <%# DataBinder.Eval(Container.DataItem, "characterization")%> I was wondering if it's possible to create a string that would contain the value of the...
14
1997
by: WT | last post by:
Hello, I have a usercontrol loaded in a page with a theme. This usercontrol contains columns template with hyperlinks, with skinID. The columns are not displayed, seems thta there is some...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.