相同形式的多次提交 [英] multiple submission in same form

查看:84
本文介绍了相同形式的多次提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在酒店添加不同的房型(例如:单人,双人间)和其他相关信息.问题是提交表单后,我需要显示带有输入的所有值的创建页面本身.怎么可能?

I have to add different room types in a hotel(eg:single ,double) and other related informations. the problem is i need to display the create page itself with all values i entered after submitting the form. How is it possible?

public ActionResult Create(Hotel hotel)
      {
         //inserting Hotel

      if (ModelState.IsValid)
      {
        //code here
       }
   ViewBag.HotelCategoryHotelCategoryId = new SelectList(db.HotelCategories, "HotelCategoryId", "CategoryName", hotel.HotelCategoryHotelCategoryId);

  return View(hotel);
      }




谁能帮我.我在mvc3中完成了编码aspx




Can anyone help me.I done coding in mvc3 aspx

推荐答案

您的视图应使用Hotel对象和控制器属性中的值填充字段方法应在调用视图之前分配这些属性.
Your view should populate the fields with the values that are in the properties of the Hotel object, and your controller method should assign those properties before calling the view.


这篇关于相同形式的多次提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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