473,657 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1017
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.Data Item, "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(tp c_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

Otherwise, I think either event will work and I'd use the Replace(cchar(1 3),
"<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****@discuss ions.microsoft. com> wrote in message
news:16******** *************** ***********@mic rosoft.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(tp c_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

Otherwise, I think either event will work and I'd use the Replace(cchar(1 3), "<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.c om...
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.Data Item, "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.c om...
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.Data Item, "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.Replac e(cchar(13), "<br/>").Replace(cch ar(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****@discuss ions.microsoft. com> wrote in message
news:16******** *************** ***********@mic rosoft.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(tp c_data_1 as varchar(8000)), char(13), '<BR/>') as
myColumn

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

Replace(cchar(1 3),
"<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****@discuss ions.microsoft. com> wrote in message
news:81******** *************** ***********@mic rosoft.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.Replac e(cchar(13), "<br/>").Replace(cch ar(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****@discuss ions.microsoft. com> wrote in message
news:16******** *************** ***********@mic rosoft.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(tp c_data_1 as varchar(8000)), char(13), '<BR/>') as myColumn

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

Replace(cchar(1 3),
"<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
4175
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. However I am unable to detect the screensaver starting when the screensaver password option is disabled. When using the WndProc Overrides I am unable to capture the screensaver event unless the application is active . Thank you in advance for any...
2
2854
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 Win32 exe project
15
26503
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
366
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. However I am unable to detect the screensaver starting when the screensaver password option is disabled. When using the WndProc Overrides I am unable to capture the screensaver event unless the application is active . Thank you in advance for any...
7
1920
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" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0
8833
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6174
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
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 we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.