首页 > 代码库 > Ajax请求。数据的提交,参数的传递。FormCollection
Ajax请求。数据的提交,参数的传递。FormCollection
<1>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <head runat="server"> <title>ajax请求</title> <link type="text/css" rel="stylesheet" href=http://www.mamicode.com/"/Content/style.css" />><2>
控制器
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Text; namespace bigtree.Controllers { using bigtree.Models; using bigtree.Model; using bigtree.lib; using System.Net.Mail; using System.Text.RegularExpressions; public class LoginController : Controller { public ActionResult Index() { return View(); } /// <summary> /// 检查登陆 /// </summary> /// <param name="f"></param> /// <returns></returns> [HttpPost] public ActionResult CheckLoginInfo(FormCollection f) { try { //post: user , pwd ,remembered string user = f["user"].Trim(); string pwd = f["pwd"].Trim(); string remembered = f["remembered"].Trim(); JsonResult res = new JsonResult(); if (string.IsNullOrEmpty(user) || string.IsNullOrEmpty(pwd)) { res.Data = http://www.mamicode.com/new { status = 0 };>Ajax请求。数据的提交,参数的传递。FormCollection
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。