Asp.Net设置绑定GridView中的控件
1、界面代码:
<asp:GridView ID="gridTemplateDetailList" runat="server"
AutoGenerateColumns="False"
onrowdatabound="gridTemplateDetailList_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="编号" >
<ItemTemplate >
<asp:Label ID="lblDetailCode" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="细则名称" >
<ItemTemplate >
<asp:Label ID="lblK_Name" runat="server" Text='<%# Eval("D_CODE") %&g
相关文档:
1. 数据库访问性能优化
数据库的连接和关闭
访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源。 ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭时 ......
ASP.NET程序中常用的三十三种代码
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string& ......
先建个html模版页(template.htm):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>$title</title>
</head>
&l ......
select top 6 * from ViewHouseSale where 1=1 and (EstateType='0' or EstateType='1')
and DateDiff(day,PubDate,getdate()) <=7 and IfBenefit='Y' and IfValid='Y' order by PubDate DESC
select top 6 * from ViewHouseSale where 1=1 and&nb ......