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
相关文档:
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryStrin ......
TinyMCE 在Asp.Net中的使用方法其实挺简单的,从官方网站下载TinyMCE),然后将里面的jscripts目录拷到你的网站目录
假设你的aspx页面中某一个地方需要用到编辑器,则加入
<asp:TextBox ID=”brand” TextMode=”MultiLine” runat=”server” />
并同时在header里加入:
<script ......
先看看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 ......
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 ......