1

I have:

function SelectSubTopics() {
    $.ajax({
        url: "/Administration/Tests/SelectSubTopics",
        data: { DataSource: $('#DataSource').val(),
            testID: $('#TestID').val(),
            showAll: True
        },
        success: function (data) {
            $('#TID').html(data);
        }
    });
}

I would like to pass a value of True through to the C# program which accepts a bool for the showALL parameter but I am getting a javascript error saying "SCRIPT5009: 'True' is undefined " Is there some special way to pass true?

2 Answers 2

4

Lower case: true - that's all. If the case is important, use a string: "True"

Sign up to request clarification or add additional context in comments.

Comments

4

Javascript is case-sensitive which means true is not True. Also note that showAll in your server-side script is not bool it's a string.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.