Thursday, August 30, 2018

JQuery Auxiliaries

Capture drop down selection change.
Here my drop down control's id is : SessionList

$(document).ready(function () {
.
.
.

    $("#SessionList").on('change', function () {
        if ($(this).val() == 'selectionKey') {
            DoSomething();
        } else {
            DoSomethingElse();
        }
    });
.
.
.
});

Do a Call to Web API and capture the results

$(document).ready(function () {
.
.
.

    $.getJSON("API/Feedbacks/GetEventFeedbacks/",
    function (Data) {
        
        var questionListing = [];
        for(var i=0; i<Data.length; ++i){
            questionListing[i] = Data[i];
        }
.
.
.
});

No comments:

Post a Comment