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 = "";
相关文档:
首页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......
Asp.net常用的51个代码(非常实用)
1.//弹出对话框.点击转向指定页面
CODE:
Response.Write("<script>window.alert('该会员没有提交申请,请重新提交!')</script>");
Response.Write("<script>window.location ='http://www.51aspx.com/bizpulic/upmeb.aspx'</script&g ......
public string ClearHtml(string HtmlStr)
{
string tmpStr = HtmlStr;
tmpStr = ReplaceHtml("&#[^>]*;", tmpStr, "");
tmpStr = ReplaceHtml("</?marquee[^>]*>", tmpStr, "");
tmpStr = ReplaceHtml("</?object[^>]*>", tmpStr, "");
tmpSt ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Pub 的摘要说明
/// </summa ......