mbtq

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

 

<%=CutString(product.Pro_Title,20) %>

页面类继承PageBase public partial class ProductListTable : Common.PageBase

namespace Common
{
public class PageBase
{

 

/// <summary>
/// 截取字符串
/// </summary>
/// <param name="content"></param>
/// <param name="length"></param>
/// <returns></returns>
protected static string CutString(string content, int length)
{
if (content.Length >= length)
{
content = content.Substring(0, length);
}

return content;
}

}

}

 

posted on 2012-08-31 15:52  mbtq  阅读(168)  评论(0编辑  收藏  举报