在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
这是js部分
function createXMLHttpRequest() 下面是AjaxChkDocDescription.ashx里的代码部分:{ if(window.XMLHttpRequest) return new XMLHttpRequest(); try{return new ActiveXObject('MSXML2.XMLHTTP.4.0');} catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP.3.0');} catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP.2.6');} catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP');} catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP');} catch(e){return null;}}}}} } function checktbxDescription() { //需要验证的字段 var tbxDescription=document.getElementById("tbxDescription").value; chkXML = createXMLHttpRequest(); if(chkXML==null){top.MessageBox.show("info","你的浏览器不支持XmlHttpRequest,请更新!",null,null);return false;} chkXML.open("GET","http://www.cnblogs.com/Ajax/AjaxChkDocDescription.ashx?Name=" + tbxDescription,true); chkXML.onreadystatechange = function() { if(chkXML.readyState == 4) { if(chkXML.status == 200) { if(chkXML.responseText == "1") { alert("[温馨提示]该名称已存在,请重新输入!"); document.getElementById("tbxDescription").select(); return false; } } } } chkXML.send(null); return true; }
using System;
using System.Data; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; namespace HCOA.Net.OAModule.Ajax }
|
请发表评论