复 制 代 码 8.// 弹 出 确 定 按 钮 <%# "<A id=\"btnDelete\"
onclick=\"return confirm(' 你 是 否 确 定 删 除 这 条 记 录 吗 ?');\"
href=\"pushproduct.aspx?dl="
+DataBinder.Eval(Container.DataItem,"code")
+"\">"+"删除"+"</A>"%>
复 制 代 码 9.//
输 出 数 据 格 式 化 "{0:F2}"
是 格 式 F2 表 示 小 数 点 后 剩 两 位 <%#
DataBinder.Eval(Container,
"DataItem.PriceMoney","
{0:F2}") %>
复 制 代 码
10.// 提 取 动 态 网 页 内 容
Uri uri = new
Uri("http://www.51aspx.com/");
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream str = resp.GetResponseStream();
StreamReader sr = new StreamReader(str,System.Text.Encoding.Default);
string t = sr.ReadToEnd();
this.Response.Write(t.ToString());
复
制
代
码
11.//
获
取
" . "
后
面
的
字
符
i.ToString().Trim().Substring(i.ToString().Trim().LastIndexOf(".")
+1).ToLower().Trim()
复制代码 12.
打开新的窗口并传送参数:
传送参数:response.write("<script>window.open(’*.aspx?id="
+this.DropDownList1.SelectIndex+"&id1="+...+"’)
</script>")
复制代码接收参数:string a = Request.QueryString("id");
string b = Request.QueryString("id1");
复
制
代
码
12.
为
按
钮
添
加
对
话
框
Button1.Attributes.Add("onclick","return
confirm(’
确
认?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’))