var selectedID= $('#@Html.IdFor(m => m.StudentId)').val();
Note: This value is a dropdownlist is read from a dropdownlist when the page loads.
why is this always giving me the result of " " when im using it in my view (mvc)??
but when i write it in console im actually getting the value of the Id.
Can someone please help me out?
Thank you in advance.

Danish HabibRank #2,024 · 715 reputationPosted Feb 21, 2016, 9:43 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Feb 21, 2016, 10:18 PM EST
var id=$('#StudentId').val();
If it helps you select it as correct answer