I want to use a variable from model:
Model.ActionId
and a varialble from javascript (selected index of dropdown)
$("#ddlMethod").val()
together in a if condition.
I have tried:
@if (Model.ActionID== 0 && $("#ddlMethod").val()== 2)
alert("yes");
another:
if (@Model.ActionID== 0 && $("#ddlMethod").val()== 2)
alert("yes");
assigning the values first:
var selectedMethod = $("#ddlMethod").val();
var actionId = @Model.ActionID;
if (actionId == 0 && selectedMethod == 2)
alert("yes");
None of them worked. Help.
