background image

复 制 代 码 8.// 弹 出 确 定 按 钮 <%#   &quot;<A   id=\&quot;btnDelete\&quot; 
onclick=\&quot;return   confirm(' 你 是 否 确 定 删 除 这 条 记 录 吗 ?');\&quot; 
href=\&quot;pushproduct.aspx?dl=&quot;
+DataBinder.Eval(Container.DataItem,&quot;code&quot;)
+&quot;\&quot;>&quot;+&quot;删除&quot;+&quot;</A>&quot;%>

复 制 代 码 9.//

 

输 出 数 据 格 式 化 "{0:F2}"  

 

是 格 式 F2 表 示 小 数 点 后 剩 两 位 <%# 

DataBinder.Eval(Container,

 

&quot;DataItem.PriceMoney&quot;,&quot;

{0:F2}&quot;) %>

复 制 代 码

10.// 提 取 动 态 网 页 内 容

Uri   uri   =   new 

Uri(&quot;http://www.51aspx.com/&quot;);

  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(&quot;.&quot;)
+1).ToLower().Trim()

复制代码 12. 

 

打开新的窗口并传送参数:

  传送参数:response.write(&quot;<script>window.open(’*.aspx?id=&quot;
+this.DropDownList1.SelectIndex+&quot;&amp;id1=&quot;+...+&quot;’)
</script>&quot;)

复制代码接收参数:string a = Request.QueryString(&quot;id&quot;);

string b = Request.QueryString(&quot;id1&quot;);

12.

Button1.Attributes.Add(&quot;onclick&quot;,&quot;return

 

confirm(’

认?’)&quot;);

button.attributes.add(&quot;onclick&quot;,&quot;if(confirm(’are you sure...?’))