62,272
社区成员
发帖
与我相关
我的任务
分享
$(function () {
$("#dl").bind("click", function () {
// alert($("#UserName").val());
if ($("#UserName").val() == "") {
alert("用户名不能为空");
}
else if ($("#PassWord").val() == "") {
alert("密码不能为空");
}
else {
$.ajax({
type: "post",
url: "/LoginController/okok",
data:JSON.stringify({ UserName:$("#UserName").val(), PassWord: $("#PassWord").val() }),
dataType: "json",
success: function (data) {
if (data == "1") {
alert("ok");
} else {
alert("on");
}
}
});
}
namespace MvcApplication1.Controllers
{
public class LoginController : Controller
{
//
// GET: /Login/
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult okok(string UserName, string PassWord)
{
return RedirectToAction("okok", "Login");
}
}
}

这个地方我复制的加了Controller,所以一直找不到,删掉后就找到了