ASP.NET常用语句
1.//弹出对话框.点击转向指定页面
Response.Write(" <script>window.alert('该会员没有提交申请,请重新提交!')
</script>");
Response.Write(" <script>window.location
='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>");
2.//弹出对话框
Response.Write(" <script language='javascript'>alert('产品添加成功!')
</script >");
3.//删除文件
string filename ="20059595157517.jpg";
pub.util.DeleteFile(HttpContext.Current.Server.MapPath("../file/")
+filename);
4.//绑定下拉列表框datalist
System.Data.DataView dv=conn.Exec_ex("select -1 as code,'请选择经营模式'
as content from dealin union select code,content from dealin");
this.dealincode.DataSource=dv;
this.dealincode.DataTextField="content";
this.dealincode.DataValueField="code";
this.dealincode.DataBind();
this.dealincode.Items.FindByValue(dv[0]["dealincode"].ToString
()).Selected=true;
5.//时间去秒显示
<%# System.DateTime.Parse(DataBinder.Eval
(Container.DataItem,"begtime").ToString()).ToShortDateString()%>
6.//标题带链接
<%# " <a class=\"12c\" target=\"_blank\"
href=\"http://www.51aspx/CV/_"+DataBinder.Eval
(Container.DataItem,"procode")+".html\">"+
DataBinder.Eval(Container.DataItem,"proname")+" </a>"%>
7.//修改转向
<%# " <A href=\"editpushpro.aspx?id="+DataBinder.Eval
(Container.DataItem,"code")+"\">"+"修改
"+" </A>"%>
8.//弹出确定按钮
<%# " <A id=\"btnDelete\" onclick=\"return confirm('你是否
确定删除这条记录吗?');\" href=\"pushproduct.aspx?
dl="+DataBinder.Eval(Container.DataItem,"code")
+"\">"+&a
相关文档:
In the last post I showed how to use the ASP.NET 3.5 Routing Engine
for URLRewriting purposes. I want to go further in this post by adding
the ability to add variables into a route path and forward and append
query string variables to the destination Web Form request.
A route can contain one or ......
1、界面代码:
<asp:GridView ID="gridTemplateDetailList" runat="server"
AutoGenerateColumns="False"
&nbs ......
先看看ASP.NET页面刷新的实现方法:
第一:
C# code
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
第二:
C# code
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( " < script langua ......
login.aspx HTML代码
1<%@ Page language="c#" Codebehind="02Login.aspx.cs" AutoEventWireup="false" Inherits="身份验证._02Login" %>
2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3<HTM ......
2010-01-25 14:24
40条ASP.NET开发Tip
作者:麒麟 来源:博客园 发布时间:2010-01-21 13:16 阅读:287 次 原文链接 [收藏]
1、在compilation 下,请设置debug=false ,如下:
default Language="c#" debug="false">
2、请使用Server.Tran ......