在Page_Load事件中添加如下代码即可:
label1.Style.Add("word-break", "break-all");
或在label1中添加style属性:
<asp:Label ID="label1" style="word-break:break-all" runat="server"></asp:Label>
比如现在有三页,第3页只有一条记录,当删除第3页的记录时,有时候可能会出错,解决的办法如下:
string listClass = Class.SelectedValue.ToString();
dgManage.DataSource = BLL.NewsInfo.ListAllNews(listClass);
try
{
dgManage.DataBind();
}
catch
{
if (dgManage.CurrentPageIndex > 0)
{
dgManage.CurrentPageIndex -= 1;
dgManage.DataBind();
}
}
![None.gif](/Images/OutliningIndicators/None.gif)
![None.gif](/Images/OutliningIndicators/None.gif)
![None.gif](/Images/OutliningIndicators/None.gif)
![None.gif](/Images/OutliningIndicators/None.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![None.gif](/Images/OutliningIndicators/None.gif)
![None.gif](/Images/OutliningIndicators/None.gif)