w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Conditional compilation is turned off? Can't assign values from Model. (RequestNumber = @Model.RequestNumber;)

Try accessing the Model properties in quotes:

$("#btnSubmitYesNon").click(function (e) {
    RequestNumber = '@Model.RequestNumber';
    ClientName = '@Model.ClientName';
    // etc.

If that also fails, then is this JavaScript part of a Razor view file, or is it external in a .js file?

I've done the quotes approach many times, so that should work (famous last words :) ).

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.