易截截图软件、单文件、免安装、纯绿色、仅160KB

Asp.net常用的51个代码(非常实用)

Asp.net常用的51个代码(非常实用)
1.//弹出对话框.点击转向指定页面
CODE:
Response.Write(&quot;<script>window.alert('该会员没有提交申请,请重新提交!')</script>&quot;);
Response.Write(&quot;<script>window.location ='http://www.51aspx.com/bizpulic/upmeb.aspx'</script>&quot;);
2.//弹出对话框
CODE:
Response.Write(&quot;<script language='javascript'>alert('产品添加成功!')</script >&quot;);
3.//删除文件
CODE:
string filename =&quot;20059595157517.jpg&quot;;
pub.util.DeleteFile(HttpContext.Current.Server.MapPath(&quot;../file/&quot;)+filename);
4.//绑定下拉列表框datalist
CODE:
System.Data.DataView dv=conn.Exec_ex(&quot;select -1 as code,'请选择经营模式' as content from dealin union select code,content from dealin&quot;);
this.dealincode.DataSource=dv;
this.dealincode.DataTextField=&quot;content&quot;;
this.dealincode.DataValueField=&quot;code&quot;;   
this.dealincode.DataBind();
this.dealincode.Items.FindByValue(dv[0][&quot;dealincode&quot;].ToString()).Selected=true;
5.//时间去秒显示
[复制到剪贴板]
CODE:
<%# System.DateTime.Parse(DataBinder.Eval(Container.DataItem,&quot;begtime&quot;).ToString()).ToShortDateString()%>
6.//标题带链接
[复制到剪贴板]
CODE:
<%# &quot;<a class=\&quot;12c\&quot; target=\&quot;_blank\&quot; href=\&quot;http://www.51aspx/CV/_&quot;+DataBinder.Eval(Container.DataItem,&quot;procode&quot;)+&quot;.html\&quot;>&quot;+ DataBinder.Eval(Container.DataItem,&quot;proname&quot;)+&quot;</a>&quot;%>
7.//修改转向
[复制到剪贴板]
CODE:
<%# &quot;<A href=\&quot;editpushpro.aspx?id=&quot;+DataBinder.Eval(Container.DataItem,&quot;code&quot;)+&quot;\&quot;>&quot;+&quot;修改&quot;+&quot;</A>&quot;%>
8.//弹出确定按钮
[复制到剪贴板]
CODE:
<%# &quot;<A


相关文档:

(转)ASP.Net邮件发送类

ASP.Net邮件发送类
本文转自:http://www.pcstu.com/program/Asp_net/sl/20070706/52523.html
说明:本文没有测试,但看起来似乎不能用于发送附件,如要发送附件,可参考:http://blog.csdn.net/lff642/archive/2008/07/15/2654346.aspx
using System;
using System.Text;
using System.IO;
using System.Net;
using ......

ASP.NET C# 生成静态页面简单方法

ASP.NET C# 生成静态页面简单方法
 
//源码是替换掉模板中的特征字符
            string mbPath = Server.MapPath("template.html");
            Encoding cod ......

ASP.NET Cache缓存详解

例子:
using system.web.caching
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
DataView Source;
// Retrieve the DataView obj ......

ASP.NET实现局部刷新GridView

 <% @ Page Language = " C# "  %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< script runat ="server" >  
  System.Data.DataView Crea ......

ASP.NET WEB.CONFIG敏感信息加密学习

今天,看到PETSHOP4.0里的WEB.CONFIG对数据库连接字符串加密,所以特意学习并记录下来。
.net 提供了 System.Configuration.RsaProtectedConfigurationProvider 。
首先配置WEB.CONFIG
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

< ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号