Home > Net >  Multiple drop-down menu how to obtain real time selected value?
Multiple drop-down menu how to obtain real time selected value?

Time:05-16

 
@ the if (Model. DealSecurities. Count & gt; 0)
{
for (int i=0; I & lt; Model. DealSecurities. Count; I++)
{

Risk Rating for @ Model. DealSecurities [I] SecurityDescription
@ Html. HiddenFor (m=& gt; M. ealSecuritiesForRiskRating [I]. Id)
@ {
Var selectedRiskRatingId=Model. ChoosenRiskRatings [I] ChoosenRiskRatingId. The ToString ();
Var selectList=new selectList (Model. RiskRatingList, "Id", "Description", selectedRiskRatingId);
}
@ Html. DropDownListFor (m=& gt; M.C hoosenRiskRatings [I] ChoosenRiskRatingId selectList, "-- SELECT --", new {@ class="SELECT - text", [I]. @ data=https://bbs.csdn.net/topics/@Model.DealSecurities Id})
@ {



}


}
}
@ Html. HiddenFor (m=& gt; M. ealBrokerDealerParameterId)


How do I get the current selected value drop-down menu? Because there are multiple drop-down menu, do not know how, please don't JS/Jquery, it is best to write in 17-19 lines, and then use the @ Html. HiddenFor (), and then click confirm Ajax to the controller,

CodePudding user response:

,,, why don't js you submit with ajax

CodePudding user response:

Refer to https://www.learnrazorpages.com/razor-pages/ajax/unobtrusive-ajax
  •  Tags:  
  • C#
  • Related