English 中文(简体)
DropDownList选择的财产在html是否发生变化?
原标题:Does the DropDownList selected property ever change in html?

我正在使用mvc3,并有一个下级名单(利用DroopDownListFor助手)。 我将选定的数值确定为我的违约值。 当用户选择一个不同的项目时,该项目的选定财产没有标明,即,违约价值在已完工的html中仍然有选定的财产。 这种正常行为吗? 如果是使用舱位和获得按揭财产,那么它就正确地归入最近选定的项目......这只是退位者如何工作? 我检查了IE、FF、Khat和IE的遗体,甚至在选择之后也拥有选定的财产。

问题回答

Edit: Infact ive just tested it with firefox 9 + . It does change the html source with the selected changing place.

<option selected="selected" value="2">(0002)    </option>
<option value="3">(0003)     </option>

确保你查看当前(更正)网页的来源和正确的选择清单。 Control + Uin 或 Chrome。

As you change the dropdownbox, behind the scenes the selected value will have changed. As you have observed. And so submitting etc will use the new selected value.

So its nothing to worry about anyway :)





相关问题
How to write a simple Html.DropDownListFor()?

In ASP.NET MVC 2, I d like to write a very simple dropdown list which gives static options. For example I d like to provide choices between "Red", "Blue", and "Green".

Html.DropDownListFor not behaving as expected ASP.net MVC

I am new to ASP.net MVC and I am having trouble getting dropdown lists to work correctly. I have a strongly typed view that is attempting to use a Html.DropDownListFor as follows: <%=Html....

ASP.Net MVC 2 DropDownListFor in EditorTemplate

I have a view model that looks like this: namespace AutoForm.Models { public class ProductViewModel { [UIHint("DropDownList")] public String Category { get; set; } [...

Incremental Sequencing DropDownListFor Binding?

I am using incremental sequencing for a collection of objects in a form. All works fine and dandy except when I need to use DropDownListFor. Lots of questions concerning binding a dropdown and ...

热门标签