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

what event should I hook to for this?

djc
I am using a repeater control to list 'detail' entries from a simple issue
tracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tags
before displaying so it maintains the users original readability as it was
input.

1) should I use the ItemCreated or the ItemDataBound event to do this? or
should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the right
direction on that it would be appreciated as well.

any input is appreciated. Thanks.

Nov 18 '05 #1
7 1007
You could do this during ItemDataBound, or, call a method in the data
binding expression in the repeater, for example, I imagine you might
be using something like:

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

Instead of using DataBinder, call your own method in code behind.
I have some examples here:
http://odetocode.com/Articles/278.aspx

HTH,

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

On Mon, 22 Nov 2004 16:00:03 -0500, "djc" <no***@nowhere.com> wrote:
I am using a repeater control to list 'detail' entries from a simple issue
tracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tags
before displaying so it maintains the users original readability as it was
input.

1) should I use the ItemCreated or the ItemDataBound event to do this? or
should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the right
direction on that it would be appreciated as well.

any input is appreciated. Thanks.


Nov 18 '05 #2
If you know you won't have more than 8000 characters in your field I would
just do the formatting in my SQL. It simplifies things greatly.

SELECT replace(cast(tpc_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

Otherwise, I think either event will work and I'd use the Replace(cchar(13),
"<BR/>") function

HTH

"djc" wrote:
I am using a repeater control to list 'detail' entries from a simple issue
tracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tags
before displaying so it maintains the users original readability as it was
input.

1) should I use the ItemCreated or the ItemDataBound event to do this? or
should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the right
direction on that it would be appreciated as well.

any input is appreciated. Thanks.

Nov 18 '05 #3
djc
thank you for the reply. I like the SQL solution. But I can't garauntee <
8000 characters since its a TEXT field. I am looking at the replace method
now. Do you think I can just replace chr(13) and leave the following chr(10)
without issue? seems to work. I know windows puts chr(13) & chr(10)
(carriage return - linefeed) but other OS's do it differently.

thanks again.

"ENIZIN" <EN****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
If you know you won't have more than 8000 characters in your field I would
just do the formatting in my SQL. It simplifies things greatly.

SELECT replace(cast(tpc_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

Otherwise, I think either event will work and I'd use the Replace(cchar(13), "<BR/>") function

HTH

"djc" wrote:
I am using a repeater control to list 'detail' entries from a simple issue tracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tags before displaying so it maintains the users original readability as it was input.

1) should I use the ItemCreated or the ItemDataBound event to do this? or should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the right direction on that it would be appreciated as well.

any input is appreciated. Thanks.

Nov 18 '05 #4
djc
thanks.... I'll check out the link now.

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:85********************************@4ax.com...
You could do this during ItemDataBound, or, call a method in the data
binding expression in the repeater, for example, I imagine you might
be using something like:

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

Instead of using DataBinder, call your own method in code behind.
I have some examples here:
http://odetocode.com/Articles/278.aspx

HTH,

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

On Mon, 22 Nov 2004 16:00:03 -0500, "djc" <no***@nowhere.com> wrote:
I am using a repeater control to list 'detail' entries from a simple issuetracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tagsbefore displaying so it maintains the users original readability as it wasinput.

1) should I use the ItemCreated or the ItemDataBound event to do this? or
should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the rightdirection on that it would be appreciated as well.

any input is appreciated. Thanks.

Nov 18 '05 #5
djc
I went with your suggestion of calling my own method. Good stuff. Thanks!

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:85********************************@4ax.com...
You could do this during ItemDataBound, or, call a method in the data
binding expression in the repeater, for example, I imagine you might
be using something like:

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

Instead of using DataBinder, call your own method in code behind.
I have some examples here:
http://odetocode.com/Articles/278.aspx

HTH,

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

On Mon, 22 Nov 2004 16:00:03 -0500, "djc" <no***@nowhere.com> wrote:
I am using a repeater control to list 'detail' entries from a simple issuetracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tagsbefore displaying so it maintains the users original readability as it wasinput.

1) should I use the ItemCreated or the ItemDataBound event to do this? or
should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the rightdirection on that it would be appreciated as well.

any input is appreciated. Thanks.

Nov 18 '05 #6
Yeah you could actually do another replace on the char(10) as well and just
replace it with an empty string. I don't think it's neccessary but you can do
it like this:

mystring = mystring.Replace(cchar(13), "<br/>").Replace(cchar(10), "")
"djc" wrote:
thank you for the reply. I like the SQL solution. But I can't garauntee <
8000 characters since its a TEXT field. I am looking at the replace method
now. Do you think I can just replace chr(13) and leave the following chr(10)
without issue? seems to work. I know windows puts chr(13) & chr(10)
(carriage return - linefeed) but other OS's do it differently.

thanks again.

"ENIZIN" <EN****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
If you know you won't have more than 8000 characters in your field I would
just do the formatting in my SQL. It simplifies things greatly.

SELECT replace(cast(tpc_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

Otherwise, I think either event will work and I'd use the

Replace(cchar(13),
"<BR/>") function

HTH

"djc" wrote:
I am using a repeater control to list 'detail' entries from a simple issue tracking system. These detail entries are MSDE2000 TEXT fields. For each
one, I need to replace all the carriage return/line feeds with '<br/>' tags before displaying so it maintains the users original readability as it was input.

1) should I use the ItemCreated or the ItemDataBound event to do this? or should I be using some other event?

2) I'm about to go lookup what vb.net functions I should use to do the
actual replacing work in the string. If someone could point me in the right direction on that it would be appreciated as well.

any input is appreciated. Thanks.


Nov 18 '05 #7
djc
Thanks agian. I appreciate it.

"ENIZIN" <EN****@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
Yeah you could actually do another replace on the char(10) as well and just replace it with an empty string. I don't think it's neccessary but you can do it like this:

mystring = mystring.Replace(cchar(13), "<br/>").Replace(cchar(10), "")
"djc" wrote:
thank you for the reply. I like the SQL solution. But I can't garauntee < 8000 characters since its a TEXT field. I am looking at the replace method now. Do you think I can just replace chr(13) and leave the following chr(10) without issue? seems to work. I know windows puts chr(13) & chr(10)
(carriage return - linefeed) but other OS's do it differently.

thanks again.

"ENIZIN" <EN****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
If you know you won't have more than 8000 characters in your field I would just do the formatting in my SQL. It simplifies things greatly.

SELECT replace(cast(tpc_data_1 as varchar(8000)), char(13), '<BR/>') as myColumn

Otherwise, I think either event will work and I'd use the

Replace(cchar(13),
"<BR/>") function

HTH

"djc" wrote:

> I am using a repeater control to list 'detail' entries from a simple

issue
> tracking system. These detail entries are MSDE2000 TEXT fields. For each > one, I need to replace all the carriage return/line feeds with '<br/>'
tags
> before displaying so it maintains the users original readability as
it was
> input.
>
> 1) should I use the ItemCreated or the ItemDataBound event to do
this? or
> should I be using some other event?
>
> 2) I'm about to go lookup what vb.net functions I should use to do
the > actual replacing work in the string. If someone could point me in

the right
> direction on that it would be appreciated as well.
>
> any input is appreciated. Thanks.
>
>
>
>


Nov 18 '05 #8

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

Similar topics

0
by: Luke | last post by:
I am trying to capture an event when the screensaver starts. I have code working on Windows XP etc when the Password/Welcome Screen is enabled . Using the Fast User Switching Notifications. ...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
15
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
0
by: Luke | last post by:
I am trying to capture an event when the screensaver starts. I have code working on Windows XP etc when the Password/Welcome Screen is enabled . Using the Fast User Switching Notifications. ...
7
by: ÀÏÆÅ»³ÔÐ5¸öÔ | last post by:
I want use dropdownlist contral in gridview but have trouble now mycode here: i'm very sorry for my poor english <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: 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
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...
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...

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.