473,327 Members | 1,896 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,327 software developers and data experts.

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 3374
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
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval:...
2
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
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
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
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...
3
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.