提交后保留并保留textboxfor的旧值

时间:2017-05-21 22:55:20

标签: c# asp.net asp.net-mvc asp.net-mvc-5

我得到这样的查询字符串:

http://localhost:52518/?Culture=en&hid=10000&Arrival=21-05-2017&Departure=22-05-2017&Adults=1&Children=0&Rooms=1

点击提交按钮后,我得到这样的结果:

http://localhost:51518/?Parameters.Checkin=21-05-2017&Parameters.Checkout=22-05-2017&Rooms=1&Adults=1&Children=0

问题是Parameters.Checkout我不想这样,我希望Arrival像上面提到的第一个链接一样。

这是.cshtml



@using (Html.BeginForm("Index", "Home", FormMethod.Get))
                {
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-4 col-lg-2">
                            <p class="font">@Resource.criteria_Arrival</p>
                            @Html.TextBoxFor(Model => Model.Parameters.Checkin, "{0:dd-MM-yyyy}", new { @class = "calendarr font", @id = "Arrival",  @name = "Arrival",  @readonly = "readonly", @onchange = "changedDate();" })
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-4 col-lg-2">
                            <p class="font">@Resource.criteria_Departure</p>
                            @Html.TextBoxFor(Model => Model.Parameters.Checkout, "{0:dd-MM-yyyy}", new { @class = "calendarr font", @id = "Departure",  @name = "Departure",  @readonly = "readonly" })
                        </div>
 }
&#13;
&#13;
&#13;

我不知道问题出在哪里,因为首先加载查询已成功加载,但第二次加载会将到达更改为签入

0 个答案:

没有答案