摘要:
在Gridview模板中放置静态的控件Radio//前台代码: <div style="text-align:center; font-size:smaller; margin:30px auto;"> <asp:GridView ID="GridView1" BorderColor="Black" runat="server" AutoGenerateColumns="False" onrowdatabound="GridView1_RowDataBound&quo 阅读全文
摘要:
格式如下图:前台格式设置如下: <asp:DataList ID="DataList1" runat="server" Style="font-size: smaller" OnItemDataBound="DataList1_ItemDataBound" OnEditCommand="DataList1_EditCommand" OnCancelCommand="DataList1_CancelCommand" onupdatecommand="DataLi 阅读全文
摘要:
要求:如果某项的值得长度大于某个值,就把此项的背景色进行修改;修改或者更新某项数据;前台代码如下: <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound" OnItemCommand="Repeater1_ItemCommand"> <ItemTemplate> <span runat="server" id="span1"> 阅读全文
摘要:
用js代码实现在Gridview中的批量删除:前台代码:View Code 1 <title>无标题页</title> 2 3 <script language="javascript" type="text/javascript"> 4 5 var check = document.getElementsByName("Checkbox1"); 6 window.onload= function() 7 { 8 for(var i = 0; i<check.length;i++) 9 {10 阅读全文
摘要:
页面源代码 1 <div> 2 <a href="test.aspx?id=add" style="text-decoration:none">增加一个用户</a> 3 <asp:GridView ID="gridview1" runat="server" AutoGenerateColumns="false"> 4 <Columns> 5 <asp:BoundField DataField ="CustomerID&q 阅读全文
摘要:
后台代码:View Code 1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!IsPostBack) 4 { 5 databind(); 6 } 7 8 } 9 public void databind()10 {11 SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ToString());12 SqlCommand cmd = new SqlCommand();13 c 阅读全文
摘要:
后端代码:后端代码 1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!IsPostBack) 4 { 5 databind(); 6 } 7 8 } 9 public void databind()10 {11 SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ToString());12 SqlCommand cmd = new SqlCommand();13 cmd.Co 阅读全文
摘要:
前端代码:JS代码 1 function Test(aa) 2 { 3 document.getElementById("img1").src ="Image/"+aa; 4 document.getElementById("div1").style.display='block'; 5 document.getElementById("div1").style.position='absolute'; 6 var x = event.clientX; 7 var y = event 阅读全文
摘要:
前台代码:JS代码 1 <script language="javascript" type="text/javascript"> 2 function Test(name,companyName,contactName,contactTitle,address) 3 { 4 var x = event.clientX; 5 var y =event.clientY; 6 document.getElementById("td1").innerText ="姓名:"+name; 7 document.g 阅读全文
摘要:
后台代码:后台代码 1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!IsPostBack) 4 { 5 databind(); 6 } 7 } 8 public void databind() 9 {10 SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ToString());11 SqlCommand cmd = new SqlCommand();12 cmd.Conn 阅读全文