I was trying to do an if else statement on my cshtml page. If the select value was given then the next select options should change. But how do I implement it without using Javascript or JQuery?
<select class="form-control" id="SomethingHere" name="SomethingHere" onchange="show(options[this.selectedIndex].value);">
<option value="SomethingHere">SomethingHere</option>
</select>
This is my first select option when I choose something on my first select, then on my second select option would change the option list
<select class="form-control" id="SomethingHere2" name="SomethingHere2" onchange="show2(options[this.selectedIndex].value);">
@ {
var SomethingHere = document.getElementById('SomethingHere').val();
//This is somehow I tried so far.
@if(SomethingHere == "SomethingHere") {
<option value="SomethingHere2">SomethingHere2</option>
}
}
</select>
Is there any other way to achieve this scenario?