English 中文(简体)
MVC3 Drop Down list change Load数据
原标题:MVC3 Drop Down list change...Load data

我有C#.Net MVC3网。 我的提议模式有“Edit View”。 关于Edit View,一份提案清单的下降名单。 所需经费是,当用户变更Droop Down名单中的选用物时,选定的提案需要由提案主计长负担。 我能够收到Edit View的介绍,但不知道如何 gr弄DownList博士的价值,以找到选定的建议。 我相信,这非常可行。 想法?

最佳回答

You could put the dropdownlist inside a form and then when the selection changes submit the form. This way the selected value will automatically be sent to the controller action. Or if you are manually doing some AJAX request when the selection changes you could send the selected value along with the request:

$( #id_of_your_ddl ).change(function() {
    var selectedProposal = $(this).val();
    $( #resultDiv ).load( @Url.Action("Index", "Proposal") , { id: selectedProposal });
});
问题回答

暂无回答




相关问题
PHP Combo Box AJAX Refresh

I have a PHP page that currently has 4 years of team positions in columns on the page. The client wants to select the players in positions and have first, second and thrid choices. Currently the page ...

jquery + ajax + json + fill dropdown list not working

I m pretty sure i am almost there....but i cannot figure out how to iterate through json objects and fill a dropdown list. Here is the js code: My JSON data returned:{"name":"County1","name":"County1"...

Gridviews and DropdownLists

Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview? for example I have a dropdown that needs to ...

Adding a new value to the drop down list box

I have a drop down list box which has one of the values to be others. I want to move these value to the last. Please help me with this. The code i am using is as follows ddlAssetsCountryOthersone....

Show hide div using codebehind

I have a DropDownList for which I am trying to show a div OnSelectedIndexChanged but it says OBJECT REQUIRED. I am binding the DataList in that div: aspx: <asp:DropDownList runat="server" ID="...

Why might dropdownlist.SelectedIndex = value fail?

I have a dropdown list that I am binding to a datatable. Here is the code I am using to do it: ddlBuildAddr.DataSource = buildings ddlBuildAddr.DataTextField = "buildingName" ddlBuildAddr....

热门标签