前台有个这个
<script language="javascript">
window.onload = function(){
login=new Login(_default);
}
</script>
后台代码
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Club
{
/// <summary>
/// _default 的摘要说明。
/// </summary>
public class _default : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Image imgCode;
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(_default)); //ajax注册类
}
[Ajax.AjaxMethod()]
public int Login(string username,string password,string vcode)
{
if(System.Web.HttpContext.Current.Request.Cookies["CheckCode"]==null)
{
return -3;//超时
}
else if(System.Web.HttpContext.Current.Request.Cookies["CheckCode"].Value!=vcode)
{
return -2;//验证码错误
}
System.Web.HttpContext.Current.Response.Cookies["CheckCode"].Value=null;
return Club.Framework.FormSecurity.Login(username,password);
}
-----------------------------------------------------------------------------
前台的 login=new Login(_default); 这个是什么意思??有什么用呢?