用jQuery表单过帐替换ASP.NET回发
我有一个登录屏幕,其中我有两个文本框和两个单选按钮。我还有一个ASP.NET按钮。当用户在我的codebehind中单击按钮时,在click even of按钮中,我有下面几行来检查用户登录用jQuery表单过帐替换ASP.NET回发,asp.net,jquery,Asp.net,Jquery,我有一个登录屏幕,其中我有两个文本框和两个单选按钮。我还有一个ASP.NET按钮。当用户在我的codebehind中单击按钮时,在click even of按钮中,我有下面几行来检查用户登录 string emailId=txtEmailId.Text.Trim(); string password=txtPassword.Text.Trim(); //Code to Check user is valid... if(isValid) {
string emailId=txtEmailId.Text.Trim();
string password=txtPassword.Text.Trim();
//Code to Check user is valid...
if(isValid)
{
Response.Redirect("index.aspx");
}
else
{
lblMSg.Text="InValid Login";
}
这是典型的ASP.NET过程。现在我想避免页面的post bak,并希望使用jQuery的表单发布。有人能指导我如何做吗?在这里,我可以将ASP.NET控件值读取为“=txtEmailId.Text”。我可以在jQuery表单发布方法中执行此操作。我知道我可以通过将emailid和密码作为查询字符串传递来执行此操作。现在我不想使用查询字符串来执行此操作。有什么想法吗
提前感谢使用$.Post发回您的页面 将您的方法公开为服务方法,以便您可以以“pagename.aspx/methodname”格式调用它