Asp.net mvc 获取BeginForm之外的下拉列表值,并使用这些值填充TextBoxFor

Asp.net mvc 获取BeginForm之外的下拉列表值,并使用这些值填充TextBoxFor,asp.net-mvc,asp.net-mvc-4,razor,Asp.net Mvc,Asp.net Mvc 4,Razor,我有两个下拉列表,在Begin之外。我需要获取这些值并将它们添加到TextBoxFor中,以便将这些值传递到我的控制器中 @Html.DropDownListFor(x => x.SelectedProductID, Model.ProductList, new { @id = "ProductList", @class = "product_list" }) @using (Html.BeginForm("Cart", "Home", FormMethod.Post

我有两个下拉列表,在Begin之外。我需要获取这些值并将它们添加到TextBoxFor中,以便将这些值传递到我的控制器中

     @Html.DropDownListFor(x => x.SelectedProductID, Model.ProductList, new { @id = "ProductList", @class = "product_list" })

     @using (Html.BeginForm("Cart", "Home", FormMethod.Post))}
        {

        @Html.TextBoxFor(m=>m.Product,new { value ="*<need the select ddl value>*", @class = "hidden" }))
.... other stuff
@Html.DropDownListFor(x=>x.SelectedProductID,Model.ProductList,new{@id=“ProductList”,@class=“product\u list”})
@使用(Html.BeginForm(“Cart”、“Home”、FormMethod.Post))}
{
@TextBoxFor(m=>m.Product,新的{value=“**”,@class=“hidden”}))
……其他东西
收听下拉列表事件,获取所选项目的值,在文本框中设置。simnple

<script type="text/javascript">
$(function(){

   $("#SelectedProductID").change(function(e){
      var selectedValue=$(this).val();
      $("#Product").val(selectedValue);
   });

});
</script>

$(函数(){
$(“#SelectedProductID”).change(函数(e){
var selectedValue=$(this.val();
$(“#产品”).val(selectedValue);
});
});

假设页面中包含jQuery库。

我确实有jQuery。我希望有一种没有jQuery的方法。我想这是唯一没有页面加载的方法。谢谢!