473,403 Members | 2,338 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,403 software developers and data experts.

Databound Item Replace

Jim
I have code
<span id="Name"><%# Container.DataItem("Name")%></span>
that I load information into the page using.

I want to perform a replace on the returned value to replace "'" with
"/'". Can anyone help with the syntax?

Thanks

Nov 17 '05 #1
3 1772
Jim,

Why not just:

Container.DataItem("Name").ToString().Replace("'", "/'");

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jim" <Ji***********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
I have code
<span id="Name"><%# Container.DataItem("Name")%></span>
that I load information into the page using.

I want to perform a replace on the returned value to replace "'" with
"/'". Can anyone help with the syntax?

Thanks

Nov 17 '05 #2
Jim
I have tried that syntax and it did not seem to work. I didn't think
the replace was valid syntax with the container object

Nov 17 '05 #3
HI

Weird, it should work as Paldino said.

Do this:
<span id="Name"><%# ReplaceText( Container.DataItem("Name") ) %></span>
in the code behind:
protected string ReplaceText( object o)
{

return o.ToString().Replace( ... );
}
just out of curiosite, put a breakpoint and see what type is o.

Another question, where is that code located? do you call DataBind() in the
page?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jim" <Ji***********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have tried that syntax and it did not seem to work. I didn't think
the replace was valid syntax with the container object

Nov 17 '05 #4

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

Similar topics

0
by: John Smith | last post by:
Hello all: Another day another problem :). How do you synch a databound combobox with the rest of the controls that are on a form. I have a combobox that lists a bunch of names and upon...
1
by: simon | last post by:
I have dataRepeater and I use its dataBound event: Private Sub rprPlists_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles...
7
by: | last post by:
I'm using ASP.NET 2.0, C#, SQL Server 2005, and databound controls like the DataList and the GridView. Right now I'm using SqlDataSource as part of very quick and dirty site; I'm not looking to...
1
by: GaryDean | last post by:
It seems every time I try to use the GridView to do what I used to do with the DataGrid I run into differences that make me want to got back to the datagrid. for instance... the DataGrid...
3
by: Jeff | last post by:
hey asp.net 2.0 I want to programmatically populate (with data from the database) a label control in a FormView on a webpage. Is it a good idea to put my logic inside the DataBound event of...
3
by: Benny | last post by:
Does anyone know how I would go about adding a blank value to the list of items in a ComboBox that has a set datasource? Thank in advance!
6
by: =?Utf-8?B?SnVzdGlu?= | last post by:
Hello: Does anyone know how I can create a multi-column listbox in VB.Net (Windows)...I am using VS.Net 2003. If there is another control available that can be databound with multiple...
2
by: Cirene | last post by:
In my databound datagrid i have a databound dropdownlist, like this: <asp:DropDownList ID="ddlAvail0" runat="server" SelectedValue='<%# Bind("AvailMon") %>'> <asp:ListItem></asp:ListItem>...
5
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Formview controls In a ASP.Net form I have 20 textboxes and 20 dropdownlists(ddl). All ddl(s) are databound and get...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.