c# - How can I access ViewModel from Javascript -
Is there a way to access a view through javascript?
I have a situation where I have many partial (representing different methods of inputing data). Some javascript on each of these inputs
The radio button list, buttons and even text boxes are straight.
But I can not get a list of dropdowns to work for.
@ html.DropDownList ("Answer", New Selection List (@ Model, "ID", "Answer Text"), "[Please Select]") & lt; Script type = "text / javascript" & gt; $ ('# Answer') Change (function () {var text = ($ ('# option option: selected'). Text ()); var id = ($ ('# answer option: selected'). Val ()); // var nextId = @Models.Find (x = & gt; x.Id == ID). Next ID; Answer selected (text, id, next id);}) & lt; / Script & gt;
Then the problem is on the line of comments. I need the answer to the selected code 3 parameters is there any way to pass my Voododal to Javascript, as I can see that I can do this I will have to change the selection ID field, "Id_NextId", and then add more JS to parse it in 2 different parameters
Comments
Post a Comment