Web Development Tips and Tricks

In this blog, I will be posting tips and tricks which will be useful for web development.

Thursday, February 17, 2005

To select first n characters without truncating a word.

In the Select query select the number of characters required.
while displaying in the datagrid.. use this
<%# DataBinder.Eval(Container.DataItem, "Article").substring(0,DataBinder.Eval(Container.DataItem, "Article").lastIndexOf(" ")+1)%>

0 Comments:

Post a Comment

<< Home