I have go this code inside my razor view in Asp.Net:
@section MyScripts {
<script type="text/javascript">
$("button").click(function () {
var myVariable = this.id;
@{
var Line1 = "Software";
var Gruppe2 = Model.Where(x => x.Line1 == "Software").GroupBy(v => v.Line2).ToList();
}
});
</script>
}
As you can see, the myVariable receives the id via jQuery from the "button click event".
So lets say that the variable value is "Software".
How can I pass this variable to the c# code inside the jQuery?