易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : asp.net

在ASP.NET中下载文件

//TransmitFile实现下载
    protected void Button1_Click(object sender, EventArgs
e)
    {
        /*
       
微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite
       
下载超过400mb的文件时导致Aspnet_wp.exe进程回收而无法成功下载的问题。
        代码如下:
        */
        Response.ContentType = "application/x-zip-compressed";
       
Response.AddHeader("Content-Disposition",
"attachment;filename=z.zip");
        string filename =
Server.MapPath("DownLoad/z.zip");
       
Response.TransmitFile(filename);
    }
    //WriteFile实现下载
    pro ......

ASP.NET中防止页面多次提交的代码实现

此处提供的代码用来实现当asp.net页面中的某个Button被点击后disable掉该页面中所有的Button,从而防止提交延时导致的多次提交。基于之前的onceclickbutton脚本.
//ASP.NET中防止页面多次提交的代码:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElement;
var objs = document.getElementsByTagName('INPUT');
for(var i=0; i< objs.length; i++)
{
if(objs[i].type.toLowerCase() == 'submit')
{
objs[i].disabled = true;
}
}
} //--> < /script>//ASP.NET中防止页面多次提交的代码:asp.netpublic class PreventMultiClick : System.Web.UI.Page {
protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.LinkButton LinkButton1; protected System.Web.UI.WebControls.Button Button3; private void Page_Load(object sender, System.EventArgs e)
{
this.GetPostBackEventReference(this.Button3);
//保证 __doPostBack(eventTarget, eventArgument) 正确注册 if ......

Ajax 基础 (asp.net C#)


<script type="text/javascript">
        var xmlHttp;
        function createXMLHttpRequest()
        {
            if(window.ActiveXObject)
            {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest)
            {
                xmlHttp = new XMLHttpRequest();
            }
   ......

Ajax 基础 (asp.net C#)


<script type="text/javascript">
        var xmlHttp;
        function createXMLHttpRequest()
        {
            if(window.ActiveXObject)
            {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest)
            {
                xmlHttp = new XMLHttpRequest();
            }
   ......

ASP.NET常用语句1

1.//弹出对话框.点击转向指定页面
Response.Write(&quot; <script>window.alert('该会员没有提交申请,请重新提交!')
</script>&quot;);
Response.Write(&quot; <script>window.location
='http://www.51aspx.com/bizpulic/upmeb.aspx' </script>&quot;);
2.//弹出对话框
Response.Write(&quot; <script language='javascript'>alert('产品添加成功!')
</script >&quot;);
3.//删除文件
string filename =&quot;20059595157517.jpg&quot;;
pub.util.DeleteFile(HttpContext.Current.Server.MapPath(&quot;../file/&quot;)
+filename);
4.//绑定下拉列表框datalist
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[ ......

ASP.NET取网页数据《数据采集》


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string strURl = "http://www.jxflcp.net/ssc/";//换成你要的那个网址
        string str = GetHttp(strURl);
        if (str != "xx")
        {
            //换成你想要截取网页部分内容的代码
            Regex reg = new Re ......

asp.net 中日期和时间的格式化

这也许是一个小问题  但是有很多学问  不能眼高手低 我把大部分情况列出来 给大家一个提醒 
float str = 987654.32F;
//Response.Write(string.Format("{0:c}", str));
//this.Label1.Text = string.Format("{0:D}", str);
//this.Label1.Text = string.Format("{0:C}", str);
Response.Write("<h1>日期格式化</h1>");
Response.Write("<br/>");
Response.Write("当前数字"+str);
Response.Write("<br/>");
Response.Write(string.Format("货币格式 {0:c}", str));
Response.Write("<br/>");
Response.Write(string.Format("科学技术法格式 {0:e}", str));
Response.Write("<br/>");
Response.Write(string.Format("科学计数法格式 12位有效数字{0:e12}", str));
Response.Write("<br/>");
Response.Write(string.Format("固定格式 {0:f}", str));
Response.Write("<br/>");
Response.Write(string.Format("固定格式 四位小数{0:f4}", str));
......
总记录数:2672; 总页数:446; 每页6 条; 首页 上一页 [407] [408] [409] [410] 411 [412] [413] [414] [415] [416]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号