在不同的视图中输入3个日期和显示顺序,点击后 [英] Enter 3 Dates And Display Order In Different VIEW, After Click

查看:68
本文介绍了在不同的视图中输入3个日期和显示顺序,点击后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,所以我试图把一个项目放在一起,以增加我对MVC3的了解,但我已经碰到了墙... ...


所以来自我的HolidaysController里面我的index'view'我创建了一个超链接,用于将用户导航到'create3'ActionResult



@ Html.ActionLink(" Select 3 Dates"," Create3")

在我的create3页面中,我希望用户在文本框中输入3个日期,当他们点击"创建"时,用户将返回到之前的HolidaysController / Index页面,其中日期将是以升序日期的顺序显示



.... ATM我有这个工作,直到用户输入3个日期并点击"创建"...但我只知道如何显示一个显示订单的消息框,它正常工作我只需要帮助从索引页面获取订单。



请参阅我的代码:



/ submit将发布到
        [HttpPost]

        public ViewResult Index(int HolidayDate)

        {

            //此帮助不需要代码

        }¥b $ b        [HttpGet]

        public ViewResult Index(string sortOrder,int?currentPersonID)

        {

//此帮助不需要代码

           返回查看(型号);
$


就在上面,我想按顺序显示我的日期,升序......



/        [HttpPost]

        public ActionResult Create3(string date1,string date2,string date3)

        {

            string FirstDateOrder,SecondDateOrder,ThirdDateOrder;



            //日期1最大

            if(date1.Length> date2.Length&& date1.Length> date3.Length)

            {

              //如果日期2是>比起日期3,然后订单是123 ...等
//同样为2和3首先是
            return RedirectToAction(" Index");

不知道从这里开始的事情就像在索引视图中创建一个参数来拉动订单一样?

任何帮助都会非常感谢大家和对论文的抱歉

Hey guys so im attempting to throw a project together to increase my knowledge of MVC3 but I have hit a wall...

So from my HolidaysController inside my index 'view' I have created a hyperlink which will navigate the user to the 'create3' ActionResult

@Html.ActionLink("Select 3 Dates", "Create3")
In my create3 page I want the user to enter 3 dates into text boxes and when they click 'create' the user will be returned to the previous HolidaysController/Index page where the dates will be displayed in order of ascending date

....ATM I have this working up until the user enters 3 dates and clicks 'create'...However I only know how to display a message box displaying the order, it is working I just need help getting the order to be displayed from the index page.

Please see my code:

/submit will go to post
        [HttpPost]
        public ViewResult Index(int HolidayDate)
        {
            //code not needed for this help
        }
        [HttpGet]
        public ViewResult Index(string sortOrder, int? currentPersonID)
        {
//code not needed for this help
            return View(model);

Just above is where I want to display my dates in order, ascending...

/        [HttpPost]
        public ActionResult Create3(string date1, string date2, string date3)
        {
            string FirstDateOrder, SecondDateOrder, ThirdDateOrder;

            //date 1 is biggest
            if (date1.Length > date2.Length && date1.Length > date3.Length)
            {
             //if date 2 is> than date 3 then order is 123...etc
//same for 2 and 3 first
            return RedirectToAction("Index");
Not sure where to go from here something like create a paramter in the Index View which pulls across the order?
Any help would be great thanks guys and sorry about the essay

推荐答案

抱歉错误的论坛。这不是关于MVC,而是关于Windows 8开发
sorry wrong forum. this is not about MVC but about windows 8 development


这篇关于在不同的视图中输入3个日期和显示顺序,点击后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆