易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net语句

   1、控制GridView控件中内容的换行
GridView1.Attributes.Add("style","word-break:keep-all;word-wrap:normal");//正常换行
GridView1.Attributes.Add("style","word-break:break-all;word-wrap:break-word");//自动换行
2、删除GridView控件行信息弹出确认提示框
在GridView的RowDataBound()事件中添加如下代码:
if(e.Row.RowType==DataControlRowType.DataRow)
{
((LinkButton)(e.Row.Cells[列数])).Attributes.Add("onclick","return confirm('确定要删除吗?')");
}
3、为DataList中的控件赋值
Label lblSelect = (Label)DataList1.Items[行号].FindControl("Label2");
lblSelect.Text = "";


相关文档:

asp.net 网站性能优化

1. 数据库访问性能优化
  数据库的连接和关闭
  访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源。ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭 ......

asp.net 读入html文件替换

cs文件:
using System.IO;
string context = "";
string path = HttpContext.Current.Server.MapPath("") + "\\test\\test.html";
 System.Text.Encoding code = System.Text.Encoding.GetEncoding("utf-8");
                Stre ......

asp.net错误处理类+SESSION类 收藏


 *  
 
 * 使用说明:1. 在Application_Start()中启动定时器(定时清空错误信息):ErrorManager.Instance.Start(),  
 
 *              默认12小时运行一次,或用ErrorManager.Instance.SetTim ......

ASP.NET 正则表达式清除HTML代码

public string ClearHtml(string HtmlStr)
{
string tmpStr = HtmlStr;
tmpStr = ReplaceHtml("&#[^>]*;", tmpStr, "");
tmpStr = ReplaceHtml("</?marquee[^>]*>", tmpStr, "");
tmpStr = ReplaceHtml("</?object[^>]*>", tmpStr, "");
tmpSt ......

asp.net中System.DateTime.Now.ToString()的一些用法


Asp.net中的日期处理函数
     //2007年4月24日
     this.TextBox6.Text = System.DateTime.Now.ToString("D");
     //2007-4-24
     this.TextBox7.Text = System.DateTime.Now.ToString("d");
 &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号