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 = "";
相关文档:
今天,看到PETSHOP4.0里的WEB.CONFIG对数据库连接字符串加密,所以特意学习并记录下来。
.net 提供了 System.Configuration.RsaProtectedConfigurationProvider 。
首先配置WEB.CONFIG
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
< ......
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 ......
public string ClearHtml(string HtmlStr)
{
string tmpStr = HtmlStr;
tmpStr = ReplaceHtml("&#[^>]*;", tmpStr, "");
tmpStr = ReplaceHtml("</?marquee[^>]*>", tmpStr, "");
tmpStr = ReplaceHtml("</?object[^>]*>", tmpStr, "");
tmpSt ......
问题一:简化版Windows XP上安装IIS5.1步骤
简化版XP操作系统的“控制面板-->添加/删除程序-->添加/删除Windows组件”中没有“Internet信息服务(IIS)”这个安装选项,于是阻碍了IIS的正常安装,通过一番网上查阅,终于找到了解决方法,其实可以按照如下步骤解决:
(一)首先在“开始&r ......
public void MyGetDepart()
{
string sSql = @"select DepartId,DepartName as '清华附中',ParentId from sDepart";
DataTable table = CommClass.GetDataTable(sSql);//BoolDAL.DbHelper.GetDataTabl ......