I'm trying to pass a variable from cshtml via Javascript to my code-behind page. I'm able to trigger the below javascript function. However the variable passed in when used inside @Html.Raw gives me the error below.
"The name 'UserProgramId ' does not exist in the current context"
My Javascript function is shown below:
function showStandingAddPanel(UserProgramId) {
$("#divStandingAddPanel").show().load("@(Html.Raw($"{ Url.Page("UserDetails", "UserStandingFormPartial")}&userId={Model.ManagedUser.UserId}&userProgramId={UserProgramId}&standingIndex={standingList.Count + 1 }"))");
}
How to pass a variable using @Html.Raw from Javascript?
