If i have such javascript in my razor veiw:
@{
Grid grid = @Model.GetGridFromModel();
Bool isSomething = @Model.GetSomething();
Bool isSomethingMore = @Model.GetSomehtingMore();
Bool isSomethingElse = @Model.GetSomethingElse()
int caseCount = 0;
}
$(document).ready(function () {
$("#tabs").tabs({
show: function (event, ui) {
switch (ui.index) {
@if (isSomething){
<text>
case @caseCount:
change('@grid.Avalue');
break;
</text>
caseCount++;
}
@if(isSomethingElse){
<text>
case @caseCount:
change('@grid.Bvalue');
break;
</text>
caseCount++;
}
@if (isSomethingElseMore){
<text>
case @caseCount:
change('@grid.Cvalue');
break;
</text>
}
}
}
});
funciton change(id)
{
//doing somehting;
}
So i want to put that javascript in separate file and reference that file to my view, and the problem is how may i pass values from razor to javascript when javascript in separate file?