Solution for label automatic line feed code and error when deleting the last page record in the DataGrid and HTML small tips: Force HTML table to break line

Source: Internet
Author: User

Add the following in the page_load event:CodeYou can:

Label1.style. Add ("word-break", "Break-all ");

Or add the style attribute in label1:

<Asp: Label id = "label1" style = "word-break: Break-all" runat = "server"> </ASP: Label>

For example, if there are three pages and only one record exists on the 3rd page, an error may occur when you delete the 3rd page record. The solution is as follows:
String listclass = Class. selectedvalue. tostring ();
Dgmanage. datasource = BLL. newsinfo. listallnews (listclass );
Try
{
Dgmanage. databind ();
}
Catch
{
If (dgmanage. currentpageindex> 0)
{
Dgmanage. currentpageindex-= 1;
Dgmanage. databind ();
}
}

How to Prevent the input table on the page from being caused by the user entering long characters in one row at a time
The page is difficult to do. In fact, you can use the CSS line feed attribute to force line breaks, as shown below:
< Table Width = "100" Style = "Word-break: Break-all" >

</ Table >  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.