HighDots Forums  

Re: asp.net and truncate

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: asp.net and truncate in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
darrel
 
Posts: n/a

Default Re: asp.net and truncate - 08-03-2004 , 04:25 PM







Quote:
How do I go about truncating text (memo field) in asp.net? I would like
to display the first 150 characters of text versus the entire 500
characters.

first off all, please just post your question ONCE

secondly, you'll probably prefer using these forums if you use an actual
newsreader.

thirdly, to answer your question:

trimmedField = left(yourMemoField,150)

-Darrel




Reply With Quote
  #2  
Old   
Usergroup User
 
Posts: n/a

Default Re: asp.net and truncate - 08-03-2004 , 05:10 PM






Wow, three for the price of one. It must be my special day.

I already tried that SQL script and it works when tested but not live?

Reply With Quote
  #3  
Old   
darrel
 
Posts: n/a

Default Re: asp.net and truncate - 08-03-2004 , 05:47 PM




Quote:
I already tried that SQL script and it works when tested but not live?
That's not a SQL script. That's just an asp.net string trimming function.

-Darrel






Reply With Quote
  #4  
Old   
Usergroup User
 
Posts: n/a

Default Re: asp.net and truncate - 08-04-2004 , 04:08 PM



You are obviously more knowledgeable than I in this situation. Where does your snippet fit into ....

<%# DataSet1.FieldValue("Story", Container).Replace(Chr(13), "<br>") %>



Reply With Quote
  #5  
Old   
darrel
 
Posts: n/a

Default Re: asp.net and truncate - 08-04-2004 , 04:25 PM




"Usergroup User" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
You are obviously more knowledgeable than I in this situation. Where does
your snippet fit into ....

%# DataSet1.FieldValue("Story", Container).Replace(Chr(13), "<br>") %
I *think* this is what you want:

<%= left(DataSet1.FieldValue("Story", Container),150).Replace(Chr(13),
"<br>") %>

But you may need to check the syntax on that.

-Darrel




Reply With Quote
  #6  
Old   
Usergroup User
 
Posts: n/a

Default Re: asp.net and truncate - 08-04-2004 , 06:35 PM



Darrel ~

Thanks, you nailed it!!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.