以备不时之需。。。。。。
1.//弹出对话框。点击转向指定页面
Response.Write(" <script>window.alert('该会员没有提交申请,请重新提交!') </script>"); ='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>"); |
Response.Write(" <script language='javascript'>alert('产品添加成功!') </script >"); |
string filename ="20059595157517.jpg"; +filename); |
System.Data.DataView dv=conn.Exec_ex("select -1 as code,'请选择经营模式' as content from dealin union select code,content from dealin"); ()).Selected=true; |
<%# System.DateTime.Parse(DataBinder.Eval (Container.DataItem,"begtime").ToString()).ToShortDateString()%> |
<%# " <a class=/"12c/" target=/"_blank/" href=/"http://www.51aspx/CV/_"+DataBinder.Eval (Container.DataItem,"procode")+".html/">"+ DataBinder.Eval(Container.DataItem,"proname")+" </a>"%> |
<%# " <A href=/"editpushpro.aspx?id="+DataBinder.Eval (Container.DataItem,"code")+"/">"+"修改 "+" </A>"%> |
8.//弹出确定按钮
<%# " <A id=/"btnDelete/" οnclick=/"return confirm('你是否 确定删除这条记录吗?');/" href=/"pushproduct.aspx? dl="+DataBinder.Eval(Container.DataItem,"code") +"/">"+"删除"+" </A>"%> |
<%# DataBinder.Eval(Container, "DataItem.PriceMoney","{0:F2} ") %> |
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()); |
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"); |
Button1.Attributes.Add("onclick","return confirm(’确认?’) "); ’)){return true;}else{return false;}") |
13.删除表格选定记录
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; intEmpID.ToString() |
14.删除表格记录警告
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) 您是否确定要删除这条信息’);"); |
15.点击表格行链接另一页
private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) ListItemType.AlternatingItem) Default.aspx?id=" + e.Item.Cells[0].Text + "’);");
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) "location.href=’../ShippedGrid.aspx?id=" + orderItemID + "’ "); 双击表格打开新一页 if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) (’../ShippedGrid.aspx?id=" + orderItemID + "’)"16.表格超连接列传递参数
18.关于日期格式 日期格式设定
19.获取错误信息并到指定页面
} |