Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am new to MVC, I want to show a view named as Filters in a dialog box on button click, in which there are two dropdowns.How can i do this? I shall be thankful for your help.

Usama
Posted

1 solution

In that case you have to use Kendo Dialog Box...!!!

First Create a Dialog Box using Below Code:

C#
var win = $("#window").kendoWindow({
        actions: ["Close"],
        draggable: false,
        height: "180px",
        modal: true,
        title: "Assign New Password",
        visible: false,
        width: "350px"
    }).data("kendoWindow");
    win.center();
    win.open();
    $("#txtPassword").val('');
}



Create
design your dropdown here


this is way of binding drop down:

keep your dropdown value in ViewBag like below:

C#
var operatorData = '@ViewBag.Operators';
    operatorData = replaceQuotes(operatorData);
    var objJSON = $.parseJSON(operatorData);



XML
function PopulateDropdownlist() {
        $.each(objJSON, function (i, item) {
            $('#ddlOperator').append($('<option>', {
                value: item.OperatorId,
                text: item.OperatorCode + '/' + item.OperatorName
            }));
        });
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900