我使用的AjaxPro.2.dll,在前台使用js调用后台的 [AjaxPro.AjaxMethod]方法,在iis5.5下运行vs08的程序,可以是他并不走 [AjaxPro.AjaxMethod]方法,在线等,急急急急急急急急急急急急急………………
问题补充:
[AjaxPro.AjaxMethod]
public string right(string uname)
{
string nCount = "";
SqlDataReader dr = null;
SqlCommand myCommand;
string cmdText = null;
SqlConnection myConnection2 = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLCONNECTION"].ConnectionString);
//cmdText = "SELECT count(*) as rsCount FROM Admin where loginname='" + uname + "' and password='" + upwd + "'";
cmdText ="SELECT a.Purview,b.PurviewGroupName FROM TemplatePurview a,PurviewGroup b,PurviewName c WHERE a.ModeID = (SELECT ModeID FROM Admin WHERE LoginName = '"+uname+"') AND b.PurviewIndexID = c.PurviewIndexID AND c.PurviewIndexID = 7 AND b.PurviewOper = a.PurviewOper";
myCommand = new SqlCommand(cmdText, myConnection2);
try
{
myConnection2.Open();
dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
}
catch (SqlException ex)
{
throw new Exception(ex.Message, ex);
}
if (dr.Read())
{
nCount = dr["Purview"].ToString();
myConnection2.Close();
}
else
{
myConnection2.Close();
return "";
}
return nCount;
}
这是right 方法
下面是用js来调用right的方法
function doorclt(add1,add2,ctp)
{
var num="";
var name ="<%=Session["nn"].ToString() %>";
var tetime="<%=Session["time"].ToString() %>";
if(ctp=="1")
{
num=Access.right(name,200);
if(num.value=="1")
{
var msgres = Access.accCltFunc(add1,add2,ctp);
if(msgres.value == false)
{
var mm=Access.adddoor(name,add1,3,0,tetime,"开门失败!");
alert("faile