知识点


//请编程遍历页面上所有textbox控件并给它赋值为string.empty
foreach (control ontrol in  this.controls)
{
if(boxcontrol is text)
{
textbox tb = (textbox)conrol;
tb.text=string.empty
}
}


//空值函数
nvl(expr1,expr2)
nvl2(expr1,expr2,expr3)
nullif(expr1,expr2) 比较1和2的值 相等返回null 不相等返回expr1的值


//replace 函数  替换
string [] sql ={"1234","2345","2356"};
for(int i =0; i<sql.length;i++)
{
sql[i]=sql[i].replace("23","ww")
console.writeline(sql[i])
}
//结果  1ww4,ww45,ww56


bind和eval函数的区别
绑定表达式:(1):<% eval("字段名")%>(2)<% bind("字段名")%>
eval单行绑定数据只读;bind双向绑定,数据可更改并返回服务器端
例:<asp:textbox id="name" runat="server" text=<% #bind("firstname")%>
<asp:textbox id="name" runat="server" text=<% #eval("productid")%>

posted @ 2010-12-07 17:09  初学软件  阅读(178)  评论(0编辑  收藏  举报