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. 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.
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.
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.
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.
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.
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.
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. > > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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.
...
|
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...
|
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
|
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.
...
|
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"...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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...
|
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: 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,...
|
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...
| |