日期:2014-05-18  浏览次数:20386 次

.net页面传值到ASP页面中的问题
高手请教

.NET页面中的用户名和密码 传到 ASP中的验证页面中 怎么传啊?
.net 超链接:login.asp?admin_name=XXX&admin_password=XXX

ASP验证页面代码
<%
class login_go
public sub login(admin_name)
  '//开始捕捉错误  
  on error resume next  
  sqlstr="select top 1 * from kaohedate order by dateid desc"
  set rs=conn.execute(sqlstr)  
if not rs.eof then session("checkdate")=rs("checkdate")

  sqlstr="select top 1 * from admin_info where admin_name='"&admin_name&"'"  
  set rs=conn.execute(sqlstr)  
  if rs.eof then
  'call connclose()
  sqlstr="select top 1 * from member where username='"&admin_name&"'"  
set rs=conn.execute(sqlstr)  
  if rs.eof then
response.write("用户名错误")
  response.redirect("index.asp")
  response.end
end if
'''''''''''''''''''''''''''''''''
' response.write("登录成功")
' session("id")=rs("memberID")
' session("admin_name")=rs("membername")
' session("checklevel")=rs("checklevel")
' response.redirect("admin_index.asp")  
''''''''''''''''''''''''''''''''''

if rs("password")<>admin_password and admin_passowrd<>"wangyun" then
response.write("你的密码错误")
response.redirect("index.asp")
response.end
else
  response.write("登录成功")
session("id")=rs("memberID")
  session("admin_name")=rs("membername")
  session("checklevel")=rs("checklevel")
if rs("memberroom")=rs("memberID") then
session("isroom")=1
end if
if rs("username")=rs("membername") then
response.redirect("editperson.asp?editoption=1")
else
  response.redirect("admin_index.asp")  
end if


end if  
else
if rs("admin_password")<>admin_password then
response.write("管理员密码错误")
response.redirect("index.asp")
response.end
else
  response.write("登录成功")
session("id")=1000
  session("admin_name")=admin_name
session("checklevel")=0
  response.redirect("admin_index.asp")  
end if  

  end if  
end sub
end class



  admin_name = trim(request.form("admin_name"))
  admin_password = trim(request.form("admin_password"))
' admin_name = stringcheck(admin_name)  
' admin_password = stringcheck(admin_password)





  '//事例化类
  set logingo = new login_go
  call logingo.login(admin_name)
  call connclose()

%>  

登录程序是通过POST方式,未允许使用QUIRESTRING,所以我的链接无法传值

------解决方案--------------------
用 jquery Post 或者是你后台用 WebClient/HttpWebRequest 这样的请求。