`

使用Anthem.NET 1.5中的FileUpload控件实现Ajax方式的文件上传

 
阅读更多

使用Anthem.NET 1.5中的FileUpload控件实现Ajax方式的文件上传

Anthem.NET我的介绍和比较还有一篇)刚刚发布了其最新的1.5版本,其中很不错的一个新功能就是对文件上传功能的Ajax实现。本文将简要介绍一下该功能的使用方法。

Anthem.NET的下载与安装

Anthem.NET可以在此下载:http://sourceforge.net/project/showfiles.php?group_id=151897&package_id=168043&release_id=493609

下载之后解压缩至硬盘中的某一目录中,编译项目得到Anthem.dll。然后将其拷贝到Web站点的bin目录下:

打开Web站点的Web.config文件,在configuration>\ <system.web>\ <pages>\ <controls>中添加如下一行,注册Anthem.NET控件:

<add tagPrefix="anthem" namespace="Anthem" assembly="Anthem"/>

Anthem.NET提供了一套自己就带有Ajax功能的、继承于现有ASP.NET控件的服务器端控件。根据上面在web.config文件中的注册,这部分控件的前缀为anthem。

Anthem.NET支持ASP.NET 1.1和ASP.NET 2.0,不过本文的示例程序均基于ASP.NET 2.0。

普通的ASP.NET文件上传

先看一下普通的ASP.NET文件上传功能的实现,代码如下:

<asp:FileUpload ID="defaultFileUpload" runat="server" />
<asp:Button ID="defaultUploadButton" runat="server" 
  OnClick="defaultUploadButton_Click" Text="Upload" />
<asp:Label ID="defaultResultLabel" runat="server" Text=""></asp:Label>

后台代码,只是简单地将文件名和文件大小显示出来:

protected void defaultUploadButton_Click(object sender, EventArgs e)
{
    defaultResultLabel.Text = string.Format("File \"{0}\" uploaded ({1} bytes).",
        defaultFileUpload.FileName,
        defaultFileUpload.FileBytes.Length
    );
}

Anthem.NET的Ajax文件上传

Anthem.NET中的Ajax文件上传功能靠的是其自己的FileUpload控件,其实使用起来和普通的ASP.NET FileUpload控件差不多,下面是HTML部分的代码:

<anthem:FileUpload ID="anthemFileUpload" runat="server" />
<anthem:Button ID="anthemUploadButton" TextDuringCallBack="uploading..." EnabledDuringCallBack="false"
    runat="server" Text="Upload" OnClick="anthemUploadButton_Click" />
<anthem:Label ID="anthemResultLabel" runat="server" Text=""></anthem:Label>

注意控件的前缀都是anthem。那个Button的TextDuringCallBack属性设置了异步回送时按钮中的文本;EnabledDuringCallBack属性让该按钮在进行异步回送时禁用,免得用户等得不耐烦。

后台代码同样是将文件名和文件大小显示出来,不过注意这一句anthemResultLabel.UpdateAfterCallBack =true;,用来在回调之后更新anthemResultLabel上的文字:

protected void anthemUploadButton_Click(object sender, EventArgs e)
{
    anthemResultLabel.Text = string.Format("File \"{0}\" uploaded ({1} bytes).",
        anthemFileUpload.FileName,
        anthemFileUpload.FileBytes.Length
    );
    anthemResultLabel.UpdateAfterCallBack = true;
}

示例程序演示

示例程序的界面如下,上面部分是普通的ASP.NET文件上传,下面是Anthem.NET的Ajax文件上传:

使用普通的ASP.NET文件上传,可以看到页面有一次闪烁,不过上传功能没什么问题:

而使用下面部分的Anthem.NET的Ajax文件上传,可以看到上传时的界面(按钮禁用,文本变化):

上传完成之后,没有页面闪烁:

打开Fiddler看看HTTP请求,上面的是传统上传,下面是Ajax的,差别显而易见……

代码下载

本文提到的完整的示例程序代码:http://files.cnblogs.com/dflying/AnthemNETFileUploadDemo.zip

更多参考资料

Anthem.NET官方网站:http://sourceforge.net/projects/anthem-dot-net/

Anthem.NET在线文档:http://anthem-dot-net.sourceforge.net/docs/

Anthem.NET在线示例程序:http://anthem.talloaksoftware.com/Default.aspx

Fiddler官方网站:http://www.fiddlertool.com/

to jeff(实现方式)

除了用IFrame,还有什么好办法么?它也是用的IFrame,相关代码如下:注意58-61,109-113,131-148这几段(粗体部分)。

有空的时候改到Atlas里面吧,呵呵,造福群众阿

function Anthem_CallBack(url, target, id, method, args, clientCallBack, clientCallBackArg, includeControlValuesWithCallBack, updatePageAfterCallBack) {
    if (typeof(window.Anthem_PreCallBack) == "function") {
        var preCallBackResult = Anthem_PreCallBack();
        if (!(typeof preCallBackResult == "undefined" || preCallBackResult)) {
            if (typeof(window.Anthem_CallBackCancelled) == "function") {
                Anthem_CallBackCancelled();
            }
            return null;
        }
    }
    var encodedData = "";
    if (target == "Page") {
        encodedData += "&Anthem_PageMethod=" + method;
    } else if (target == "MasterPage") {
        encodedData += "&Anthem_MasterPageMethod=" + method;
    } else if (target == "Control") {
        encodedData += "&Anthem_ControlID=" + id.split(":").join("_");
        encodedData += "&Anthem_ControlMethod=" + method;
    }
    if (args) {
        for (var argsIndex = 0; argsIndex < args.length; ++argsIndex) {
            if (args[argsIndex] instanceof Array) {
                for (var i = 0; i < args[argsIndex].length; ++i) {
                    encodedData += "&Anthem_CallBackArgument" + argsIndex + "=" + Anthem_Encode(args[argsIndex][i]);
                }
            } else {
                encodedData += "&Anthem_CallBackArgument" + argsIndex + "=" + Anthem_Encode(args[argsIndex]);
            }
        }
    }
    
    if (updatePageAfterCallBack) {
        encodedData += "&Anthem_UpdatePage=true";
    }
    
    // Anthem will normally use an XmlHttpRequest to communicate with the server. 
    // But if an Anthem.FileUpload control is discovered on the page, then Anthem
    // will use a hidden IFRAME instead. This hidden IFRAME is often called an IOFrame
    // by AJAX library authors, so that is the name we use here.
    var useIOFrame = false;
    
    // Scan the controls on the form and extract their values.
    if (includeControlValuesWithCallBack) {
        var form = Anthem_GetForm();
        if (form != null) {
            for (var elementIndex = 0; elementIndex < form.length; ++elementIndex) {
                var element = form.elements[elementIndex];
                if (element.name) {
                    var elementValue = null;
                    if (element.nodeName.toUpperCase() == "INPUT") {
                        var inputType = element.getAttribute("type").toUpperCase();
                        if (inputType == "TEXT" || inputType == "PASSWORD" || inputType == "HIDDEN") {
                            elementValue = element.value;
                        } else if (inputType == "CHECKBOX" || inputType == "RADIO") {
                            if (element.checked) {
                                elementValue = element.value;
                            }
                        } else if (inputType == "FILE") {
                            // If the FILE element has a value (the path to the file), then an
                            // IOFrame will be used to handle the callback.
                            useIOFrame = useIOFrame | !(element.value == null || element.value.length == 0);
                        }
                    } else if (element.nodeName.toUpperCase() == "SELECT") {
                        if (element.multiple) {
                            elementValue = [];
                            for (var i = 0; i < element.length; ++i) {
                                if (element.options[i].selected) {
                                    elementValue.push(element.options[i].value);
                                }
                            }
                        } else if (element.length == 0) {
                            elementValue = null;
                        } else {
                            elementValue = element.value;
                        }
                    } else if (element.nodeName.toUpperCase() == "TEXTAREA") {
                        elementValue = element.value;
                    }
                    if (elementValue instanceof Array) {
                        for (var i = 0; i < elementValue.length; ++i) {
                            encodedData += "&" + element.name + "=" + Anthem_Encode(elementValue[i]);
                        }
                    } else if (elementValue != null) {
                        encodedData += "&" + element.name + "=" + Anthem_Encode(elementValue);
                    }
                }
            }
            // ASP.NET 1.1 won't fire any events if neither of the following
            // two parameters are not in the request so make sure they're
            // always in the request.
            if (typeof form.__VIEWSTATE == "undefined") {
                encodedData += "&__VIEWSTATE=";
            }
            if (typeof form.__EVENTTARGET == "undefined") {
                encodedData += "&__EVENTTARGET=";
            }
        }
    }
    
    if (encodedData.length > 0) {
        encodedData = encodedData.substring(1);
    }
    if (typeof(Anthem_DebugRequestText) == "function") {
        Anthem_DebugRequestText(encodedData.split("&").join("\n&"));
    }

    // Send the callback request to the server. Use an IOFrame if there is a file upload,
    // otherwise use an XmlHttpRequest.
    if (useIOFrame) {
        // To allow multiple requests at the same time, all of the Anthem parameters are 
        // passed to the server via the querystring
        var action = Anthem_GetCallBackUrl();
        action = action + "&Anthem_IOFrame=true";
        if (updatePageAfterCallBack) {
            action = action + "&Anthem_UpdatePage=true";
        }
        
        // We could generate an anonymous function on the fly to handle the clientCallBack
        // and assign that to the iframe onload event (in fact this is how XmlHttpRequests are
        // handled). But that makes it very hard to debug the callback response. Instead
        // we will stuff the clientCallBack function and args into an array and then hard code
        // the onload event handler. The handler will find the appropriate callback info in
        // the array and handle the clientCallBack.
        var id = "f" + new String(Math.floor(9999 * Math.random())); // Generate frame number
        if (typeof(clientCallBack) == "function") {
            var frame = { "id":id, "clientCallBack":clientCallBack, "clientCallBackArg":clientCallBackArg };
            callbackFrames.push(frame);
        }
        
        // Create a new, invisible iframe to handle the io.
        var ioframe = null;
        if (window.ActiveXObject) {
            ioframe = document.createElement("<iframe name=\"" + id + "\" id=\"" + id + "\" onload=\"Anthem_HandleIOFrameResponse('" + id + "');\"/>");
        } else {
            ioframe = document.createElement("iframe");
            ioframe.id = id;
            ioframe.name = id;
            ioframe.onload = function (){ Anthem_HandleIOFrameResponse(id); }
        }
        ioframe.style.visibility = "hidden";
        ioframe.style.height = "1px";
        document.body.appendChild(ioframe);
        // Submit this form in the hidden iframe
        var theForm = Anthem_GetForm(); 
        var tempActionUri = theForm.action; 
        theForm.action = action; 
        theForm.target = id;
        try { 
            theForm.submit(); 
        } catch (e) {
            result = { "value": null, "error": e.message };
            if (typeof(Anthem_DebugError) == "function") {
                Anthem_DebugError(e.name + ": " + e.message + " (" + e.number + ")");
            }
            if (typeof(window.Anthem_Error) == "function") {
                Anthem_Error(result);
            }            
        }

        // Restore the form 
        theForm.target = ""; 
        theForm.action = tempActionUri;
        
    } else {
    
        var x = Anthem_GetXMLHttpRequest();
        var result = null;
        if (!x) {
            result = { "value": null, "error": "NOXMLHTTP" };
            if (typeof(Anthem_DebugError) == "function") {
                Anthem_DebugError(result.error);
            }
            if (typeof(window.Anthem_Error) == "function") {
                Anthem_Error(result);
            }
            if (typeof(clientCallBack) == "function") {
                clientCallBack(result, clientCallBackArg);
            }
            return result;
        }
        var action = Anthem_GetCallBackUrl();
        x.open("POST", url ? url : action, clientCallBack ? true : false);
        x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
        x.setRequestHeader("Accept-Encoding", "gzip, deflate");
        if (typeof(clientCallBack) == "function") {
            x.onreadystatechange = function() {
                if (x.readyState != 4) {
                    return;
                }
                if (typeof(Anthem_DebugResponseText) == "function") {
                    Anthem_DebugResponseText(x.responseText);
                }
                result = Anthem_GetResult(x);
                if (result.error) {
                    if (typeof(Anthem_DebugError) == "function") {
                        Anthem_DebugError(result.error);
                    }
                    if (typeof(window.Anthem_Error) == "function") {
                        Anthem_Error(result);
                    }
                }
                if (updatePageAfterCallBack) {
                    Anthem_UpdatePage(result);
                }
                Anthem_EvalClientSideScript(result);
                clientCallBack(result, clientCallBackArg);
                x = null;
                if (typeof(window.Anthem_PostCallBack) == "function") {
                    Anthem_PostCallBack();
                }
            }
        }
        x.send(encodedData);
        if (typeof(clientCallBack) != "function") {
            if (typeof(Anthem_DebugResponseText) == "function") {
                Anthem_DebugResponseText(x.responseText);
            }
            result = Anthem_GetResult(x);
            if (result.error) {
                if (typeof(Anthem_DebugError) == "function") {
                    Anthem_DebugError(result.error);
                }
                if (typeof(window.Anthem_Error) == "function") {
                    Anthem_Error(result);
                }
            }
            if (updatePageAfterCallBack) {
                Anthem_UpdatePage(result);
            }
            Anthem_EvalClientSideScript(result);
            if (typeof(window.Anthem_PostCallBack) == "function") {
                Anthem_PostCallBack();
            }
        }
    }    
    return result;
}
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on 2007-03-25 12:10Dflying Chen阅读(10503)评论(55)编辑收藏

评论:
#1楼2007-03-25 12:19|Neo.h
从1.2的版本的时候就开始用了,反而觉得1.2的版本比较稳定。1.3以上包括使用1.5的当过程较复杂的时候经常使用UpdateAfterCallback=true这句话是都是没有反应更新不了,使用回1.2的控件就可以不知道你碰到这样的情况没有。
 回复 引用 查看 
#2楼[楼主]2007-03-25 12:25|Dflying Chen
@Neo.h
1.2的时候还没有FileUpload吧?
我也是浅尝辄止随便试试看,呵呵,没什么实际使用经验。不过版本越高,估计功能就越丰富,自然出错的可能性就大了……

 回复 引用 查看 
#3楼2007-03-25 12:34|Neo.h
@dflying
不好意思,没表达清楚。我说的不只是FileUpload,Anthem.NET里面的所有控件基本上都有UpdateAfterCallback这个方法,用来通知控件更新显示的方法。1.2里面也有,1.5也有。只不过使用1.2从来没有这样的问题,1.3的版本出来以后就碰到这样的问题,到1.5那天我去下载来试了一下还是有这样的问题。在IE里面设置了允许客户端调试,发现当很多的控件集合在一起使用的时候方法里面所有的过程都执行了一遍,最后执行UpdateAfterCallback=true;还是没有更新控件的显示,换到了1.2的版本显示又正常了。真是挺怪的。所以到了现在还是用回1.2版本的,觉得还是1.2实用。

 回复 引用 查看 
#4楼[楼主]2007-03-25 12:38|Dflying Chen
@Neo.h
恩,如果自己解决不了的话,给开发者发一个Bug吧,呵呵
功能丰富了,可能一些bug就会出现

 回复 引用 查看 
#5楼2007-03-25 12:47|Neo.h
@Dflying
谢谢你的建议,以后如果你有研究Anthem.NET这方面话的希望大家能互相交流学习。

 回复 引用 查看 
#6楼[楼主]2007-03-25 12:50|Dflying Chen
@Neo.h
谢谢你的关注,欢迎常来看看,我们一起探讨!

 回复 引用 查看 
#7楼2007-03-25 13:06|Jeffrey Zhao
对于实现很感兴趣,能不能介绍一下啊?:)
 回复 引用 查看 
#8楼2007-03-25 14:01|木野狐
关注,不过现在暂时不怎么做 .net 了。
 回复 引用 查看 
#9楼[楼主]2007-03-25 14:13|Dflying Chen
@Jeffrey Zhao
更新在文章中了……本来想贴在回复中,没想到居然是这个错误???
---------------------------
Error
---------------------------
A Runtime Error has occurred.
Do you wish to Debug?

Line: 279
Error: The disk is full.


---------------------------
Yes No
---------------------------

 回复 引用 查看 
#10楼[楼主]2007-03-25 14:13|Dflying Chen
除了用IFrame,还有什么好办法么?它也是用的IFrame,相关代码如下:注意58-61,109-113,131-148这几段。
有空的时候改到Atlas里面吧,呵呵,造福群众阿
functionAnthem_CallBack(url,target,id,method,args,clientCallBack,clientCallBackArg,includeControlValuesWithCallBack,updatePageAfterCallBack){
if(typeof(window.Anthem_PreCallBack)=="function"){
varpreCallBackResult=Anthem_PreCallBack();
if(!(typeofpreCallBackResult=="undefined"||preCallBackResult)){
if(typeof(window.Anthem_CallBackCancelled)=="function"){
Anthem_CallBackCancelled();
}

returnnull;
}

}

varencodedData="";
if(target=="Page"){
encodedData
+="&Anthem_PageMethod="+method;
}
elseif(target=="MasterPage"){
encodedData
+="&Anthem_MasterPageMethod="+method;
}
elseif(target=="Control"){
encodedData
+="&Anthem_ControlID="+id.split(":").join("_");
encodedData
+="&Anthem_ControlMethod="+method;
}

if(args){
for(varargsIndex=0;argsIndex<args.length;++argsIndex){
if(args[argsIndex]instanceofArray){
for(vari=0;i<args[argsIndex].length;++i){
encodedData
+="&Anthem_CallBackArgument"+argsIndex+"="+Anthem_Encode(args[argsIndex][i]);
}

}
else{
encodedData
+="&Anthem_CallBackArgument"+argsIndex+"="+Anthem_Encode(args[argsIndex]);
}

}

}


if(updatePageAfterCallBack){
encodedData
+="&Anthem_UpdatePage=true";
}


//AnthemwillnormallyuseanXmlHttpRequesttocommunicatewiththeserver.
//ButifanAnthem.FileUploadcontrolisdiscoveredonthepage,thenAnthem
//willuseahiddenIFRAMEinstead.ThishiddenIFRAMEisoftencalledanIOFrame
//byAJAXlibraryauthors,sothatisthenameweusehere.
varuseIOFrame=false;

//Scanthecontrolsontheformandextracttheirvalues.
if(includeControlValuesWithCallBack){
varform=Anthem_GetForm();
if(form!=null){
for(varelementIndex=0;elementIndex<form.length;++elementIndex){
varelement=form.elements[elementIndex];
if(element.name){
varelementValue=null;
if(element.nodeName.toUpperCase()=="INPUT"){
varinputType=element.getAttribute("type").toUpperCase();
if(inputType=="TEXT"||inputType=="PASSWORD"||inputType=="HIDDEN"){
elementValue
=element.value;
}
elseif(inputType=="CHECKBOX"||inputType=="RADIO"){
if(element.checked){
elementValue
=element.value;
}

}
elseif(inputType=="FILE"){
//IftheFILEelementhasavalue(thepathtothefile),thenan
//IOFramewillbeusedtohandlethecallback.
useIOFrame=useIOFrame|!(element.value==null||element.value.length==0);
}

}
elseif(element.nodeName.toUpperCase()=="SELECT"){
if(element.multiple){
elementValue
=[];
for(vari=0;i<element.length;++i){
if(element.options[i].selected){
elementValue.push(element.options[i].value);
}

}

}
elseif(element.length==0){
elementValue
=null;
}
else{
elementValue
=element.value;
}

}
elseif(element.nodeName.toUpperCase()=="TEXTAREA"){
elementValue
=element.value;
}

if(elementValueinstanceofArray){
for(vari=0;i<elementValue.length;++i){
encodedData
+="&"+element.name+"="+Anthem_Encode(elementValue[i]);
}

}
elseif(elementValue!=null){
encodedData
+="&"+element.name+"="+Anthem_Encode(elementValue);
}

}

}

//ASP.NET1.1won'tfireanyeventsifneitherofthefollowing
//twoparametersarenotintherequestsomakesurethey're
//alwaysintherequest.
if(typeofform.__VIEWSTATE=="undefined"){
encodedData
+="&__VIEWSTATE=";
}

if(typeofform.__EVENTTARGET=="undefined"){
encodedData
+="&__EVENTTARGET=";
}

}

}


if(encodedData.length>0){
encodedData
=encodedData.substring(1);
}

if(typeof(Anthem_DebugRequestText)=="function"){
Anthem_DebugRequestText(encodedData.split(
"&").join("\n&"));
}


//Sendthecallbackrequesttotheserver.UseanIOFrameifthereisafileupload,
//otherwiseuseanXmlHttpRequest.
if(useIOFrame){
//Toallowmultiplerequestsatthesametime,alloftheAnthemparametersare
//passedtotheserverviathequerystring
varaction=Anthem_GetCallBackUrl();
action
=action+"&Anthem_IOFrame=true";
if(updatePageAfterCallBack){
action
=action+"&Anthem_UpdatePage=true";
}


//WecouldgenerateananonymousfunctionontheflytohandletheclientCallBack
//andassignthattotheiframeonloadevent(infactthisishowXmlHttpRequestsare
//handled).Butthatmakesitveryhardtodebugthecallbackresponse.Instead
//wewillstufftheclientCallBackfunctionandargsintoanarrayandthenhardcode
//theonloadeventhandler.Thehandlerwillfindtheappropriatecallbackinfoin
//thearrayandhandletheclientCallBack.
varid="f"+newString(Math.floor(9999*Math.random()));//Generateframenumber
if(typeof(clientCallBack)=="function"){
varframe={"id":id,"clientCallBack":clientCallBack,"clientCallBackArg":clientCallBackArg};
callbackFrames.push(frame);
}


//Createanew,invisibleiframetohandletheio.
varioframe=null;
if(window.ActiveXObject){
ioframe
=document.createElement("<iframename=\""+id+"\"id=\""+id+"\"onload=\"Anthem_HandleIOFrameResponse('"+id+"');\"/>");
}
else{
ioframe
=document.createElement("iframe");
ioframe.id
=id;
ioframe.name
=id;
ioframe.onload
=function(){Anthem_HandleIOFrameResponse(id);}
}

ioframe.style.visibility
="hidden";
ioframe.style.height
="1px";
document.body.appendChild(ioframe);

//Submitthisforminthehiddeniframe
vartheForm=Anthem_GetForm();
vartempActionUri=theForm.action;
theForm.action
=action;
theForm.target
=id;
try{
theForm.submit();
}
catch(e){
result
={"value":null,"error":e.message};
if(typeof(Anthem_DebugError)=="function"){
Anthem_DebugError(e.name
+":"+e.message+"("+e.number+")");
}

if(typeof(window.Anthem_Error)=="function"){
Anthem_Error(result);
}

}


//Restoretheform
theForm.target="";
theForm.action
=tempActionUri;

}
else{

varx=Anthem_GetXMLHttpRequest();
varresult=null;
if(!x){
result
={"value":null,"error":"NOXMLHTTP"};
if(typeof(Anthem_DebugError)=="function"){
Anthem_DebugError(result.error);
}

if(typeof(window.Anthem_Error)=="function"){
Anthem_Error(result);
}

if(typeof(clientCallBack)=="function"){
clientCallBack(result,clientCallBackArg);
}

returnresult;
}

varaction=Anthem_GetCallBackUrl();
x.open(
"POST",url?url:action,clientCallBack?true:false);
x.setRequestHeader(
"Content-Type","application/x-www-form-urlencoded;charset=utf-8");
x.setRequestHeader(
"Accept-Encoding","gzip,deflate");
if(typeof(clientCallBack)=="function"){
x.onreadystatechange
=function(){
if(x.readyState!=4){
return;
}

if(typeof(Anthem_DebugResponseText)=="function"){
Anthem_DebugResponseText(x.responseText);
}

result
=Anthem_GetResult(x);
if(result.error){
if(typeof(Anthem_DebugError)=="function"){
Anthem_DebugError(result.error);
}

if(typeof(window.Anthem_Error)=="function"){
Anthem_Error(result);
}

}

if(updatePageAfterCallBack){
Anthem_UpdatePage(result);
}

Anthem_EvalClientSideScript(result);
clientCallBack(result,clientCallBackArg);
x
=null;
if(typeof(window.Anthem_PostCallBack)=="function"){
Anthem_PostCallBack();
}

}

}

x.send(encodedData);
if(typeof(clientCallBack)!="function"){
if(typeof(Anthem_DebugResponseText)=="function"){
Anthem_DebugResponseText(x.responseText);
}

result
=Anthem_GetResult(x);
if(result.error){
if(typeof(Anthem_DebugError)=="function"){
Anthem_DebugError(result.error);
}

if(typeof(window.Anthem_Error)=="function"){
Anthem_Error(result);
}

}

if(updatePageAfterCallBack){
Anthem_UpdatePage(result);
}

Anthem_EvalClientSideScript(result);
if(typeof(window.Anthem_PostCallBack)=="function"){
Anthem_PostCallBack();
}

}

}

returnresult;
}
分享到:
评论

相关推荐

    Anthem.NET中FileUpload控件Ajax方式的文件上传

    使用Anthem.NET 1.5中的FileUpload控件实现Ajax方式的文件上传

    商业编程-源码-Anthem.NET中FileUpload控件Ajax方式的文件上传.zip

    商业编程-源码-Anthem.NET中FileUpload控件Ajax方式的文件上传.zip

    Anthem.NET详细安装步骤

    Anthem.NET详细安装步骤, Anthem.NET的安装其实很简单,但是如果不知道安装步骤,确实还是有点恼火的!本人初学Ajax,下面总结我安装的整体步骤以及一些体会。(Visual Studio 2005 环境)

    anthem.net

    用起來很爽的ajax框架,是開源項目,速度快而且使用及其簡單,裡面包含源碼,可用在vs2003和vs2005

    Anthem.1.5

    Anthem.1.5 dll 用于asp.net的Ajax的开发

    C#.NET 无刷新控件

    Anthem.net是一种新的AJAX技术,它主要是提供了一个新控件库,库中包含了大量常用控件,如Button、Calendar、 CheckBox等等,到目前为止为ASP.NET提供了24种新控件,实用于ASP.NET 1.0 和 ASP.NET 2.0 。

    anthem控件及例子

    一个最简单的在asp.net中实现ajax,有anthem.dll和案例

    anthem ajax控件

    anthem ajax控件 anthem ajax控件

    Article(ajax).rar_Anthem.d_ajax .net_ajax CSharp_left right 图片_分

    使用Anthem.Net做的Ajax后台. Access + .net2.0 使用VS2005开发. 基本功能:. 1) 栏目无限分级,可添加专题栏目. 2) 栏目显示分四种显示风格:列表式,简介式

    asp.net知识库

    在ASP.NET中使用WINDOWS验证方式连接SQL SERVER数据库 改进ADO.Net数据库访问方式 ASP.NET 2.0 绑定高级技巧 简单实用的DataSet更新数据库的类+总结 [ADO.NET]由数据库触发器引发的问题 为ASP.NET封装的SQL数据库...

    Ajax无刷新整合型网站论坛一体化开源框架

    3.采用Anthem.net实现ajax效果,无需依赖ASP.NET AJAX的任何库文件。 4.用户注册登录全部采用ASP.NET2.0内置的现成控件实现。 5.网站菜单分类请修改数据库中的Catalog及Class,支持二级主题分类。 6.Catalog表中的...

    Anthem.dll for vs.net 2005

    Anthem.dll for vs.net 2005

    AspxCn无刷新整合型网站开源框架(VS2005+SQL2005)

    4.采用Anthem.net实现ajax效果,无需依赖ASP.NET AJAX的任何库文件。 5.用户注册登录全部采用ASP.NET2.0内置的现成控件实现。 6.网站菜单分类请修改数据库中的Catalog及Class,支持二级主题分类。 7.Catalog表中的...

    AspxCn无刷新整合型网站开源框架 Preview 1.0

    4.采用Anthem.net实现ajax效果,无需依赖ASP.NET AJAX的任何库文件。 5.用户注册登录全部采用ASP.NET2.0内置的现成控件实现。 6.网站菜单分类请修改数据库中的Catalog及Class,支持二级主题分类。 7.Catalog表中的...

    现所流行众Ajax控件众最强的_Anthem2.0

    目前流行的Ajax控件有三种: 1.AjaxPro 2.微软的Atlas 3.Anthem AjaxPro要自己写前台方法操作起来很繁琐,要配制web.config,而且容易出错 Atlas使用虽然方便,但web.config配置太麻烦,而且无发自定义调用后台方法 ...

    ajax控件插件

    包含了Microsoft官方的ajax控件和非官方的Anthem控件,anthem是轻量级的ajax控件,非常好用,比普通asp.net控件+UpdataPanel要好的多,详细情况可以去google一下!

    xkz.rar_ajax_vs2005_生成静态_登陆 页面_静态 颜色

    使用Anthem.Net做的Ajax后台,Access + .net2.0 使用VS2005开发,仿照nbArticle开发 基本功能: 1) 栏目无限分级,可添加专题栏目 2) 栏目显示分四种显示风格:列表式,简介式,图片式,图文式 3) 添加文章可选标题颜色...

    anthem-1.5.1

    anthem-1.5 包话2003 和2005 两个版本,编译后即可使用。源码。

    asp.net博客系统

    后台因安全原因使用服务器端的anthem.net框架开发,实现数据操作无刷新 所有数据操作全部封装在数据库里,一定程度上提高了性能 无刷新动态换肤,并支持自定义皮肤样式 系统暂时支持ie7、firefox+、maxthon、腾讯tt...

Global site tag (gtag.js) - Google Analytics