当前位置: 首页 > news >正文

网站页脚导航注册网站乱填邮箱

网站页脚导航,注册网站乱填邮箱,沈阳亚洲城属于哪个社区,seo关键词排名优化软件一、需求分析 实现效果 二、实现步骤 步骤一#xff1a;新建项目---Web----空模板 步骤二#xff1a;添加控制器 步骤三#xff1a;根据控制器名称添加视图 步骤四#xff1a;添加Models模型 编写具体的方法 using System;using System.Collections.Generic;using…一、需求分析 实现效果   二、实现步骤   步骤一新建项目---Web----空模板   步骤二添加控制器 步骤三根据控制器名称添加视图 步骤四添加Models模型  编写具体的方法 using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace MVCDemo.Models{    public class Calculator    {        public int getAVG(int sumScore,int sumSubject)        {            return sumScore / sumSubject;        }    }} 步骤五编写视图具体展示的内容 {    Layout null;}!DOCTYPE htmlhtmlhead    meta nameviewport contentwidthdevice-width /    titleCalculatorView/title/headbody    form methodpost action/Calculator/Calculate        计算平均成绩br/        总成绩input typetext namesumScore / br/        总科目input typetext namesumSubject /br/        input typesubmit  value开始计算/br/        ViewData[avgScore]      /form   /body/html 步骤六编写控制器活动方法 using MVCDemo.Models;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace MVCDemo.Controllers{    public class CalculatorController : Controller    {        // GET: Calculator        public ActionResult Index()        {            return View(CalculatorView);        }        public ActionResult Calculate()        {            //[1]获取数据            int sumScore Convert.ToInt32(Request.Params[sumScore]);            int sumSubject Convert.ToInt32(Request.Params[sumSubject]);            //[2]处理数据            Calculator objCal new Calculator();            int avgScore objCal.getAVG(sumScore, sumSubject);            //[3]返回数据            ViewData[avgScore] 平均成绩为 avgScore;            return View(CalculatorView);        }    }} 步骤七修改路由 using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Web.Routing;namespace MVCDemo{    public class RouteConfig    {        public static void RegisterRoutes(RouteCollection routes)        {            routes.IgnoreRoute({resource}.axd/{*pathInfo});            routes.MapRoute(                name: Default,                url: {controller}/{action}/{id},                defaults: new { controller Calculator, action Index, id UrlParameter.Optional }            );        }    }}  转载于:https://www.cnblogs.com/cuig/p/8950589.html
http://www.zqtcl.cn/news/144063/

相关文章:

  • android 旅游网站开发有哪些做伦敦金的网站
  • 物流网站系统php源码seo课程多少钱
  • 手机 网站品牌网站建设 d磐石网络
  • 免费用搭建网站珠海住房和建设局网站
  • 天津做胎儿鉴定网站广州古德室内设计有限公司logo
  • 做爰的最好看的视频的网站简洁型网页
  • 网站一直显示建设中网页制作工具程
  • 苏州seo网站管理网站后台更新后主页没有变化
  • 上海网站公司电话中国电子信息网
  • 合作网站seo在哪里建网站免费
  • 需求网站自动发卡网站开发
  • 用asp做网站span电子商务网站建设的教案
  • 厦门市住房建设网站音乐主题wordpress
  • 小说网站开发文档建站公司用wordpress
  • 自己做手机版网站制作佛山网站建设企划动力
  • 鄂州建设工程造价信息管理网站wordpress 3.9 编辑文章 固定链接 不能编辑
  • asp网站的安全性织梦移动端网站建设
  • 大网站的二级域名哪些平台可以发布产品
  • 旅游网站开发说明书怎么做好销售
  • 网站app生成器天河网站建设服务
  • 南京移动网站建设哪里强新网站建设都需要哪些
  • .net网站制作wordpress配置多语言包
  • 上海源码网站建设公司做短视频的网站都有哪些
  • 网络推广公司联系昔年下拉网络优化seo
  • 网站开发语言识别网站众筹该怎么做
  • 长春做网站公司长春seo公司云主机和云服务器的区别
  • 打开网站乱码怎么做网件路由器登陆网址
  • wordpress 怎么删除主题seo神马网站推广器
  • 番禺网站推广公司宣传片拍摄方案范本
  • 网站建设的公司收费建筑英才网app