or
using System;using System.Collections.Generic;using System.Linq;using System.Web.Services;namespace WebApplication3{ public partial class _default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static IEnumerable<Comuni> ListaComuni() { using (var northwind = new DataClasses1DataContext()) { var lista = northwind.CAPCOM.Where(row=> row.CapComId<100) // Use a view model to avoid serializing internal Entity Framework properties as JSON .Select(p => new Comuni() { CapComId = p.CapComId, CapComCod = p.CapComCod, CapComCom = p.CapComCom }) .ToList(); return lista; } } public class Comuni { public int CapComId { get; set; } public string CapComCod { get; set; } public string CapComCom { get; set; } public int Total { get; set; } } }}[{"Active":true,"DisplayText":"Flyers","TemplateCategoryID":1},{"Active":true,"DisplayText":"Door Hangers","TemplateCategoryID":2},{"Active":true,"DisplayText":"Postcards","TemplateCategoryID":3},{"Active":true,"DisplayText":"Tri-Fold","TemplateCategoryID":4},{"Active":true,"DisplayText":"Facebook Graphics","TemplateCategoryID":5}]@(Html.Kendo().ComboBox() .Name("templateCat") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget. .DataTextField("DisplayText") //Specifies which property of the Product to be used by the combobox as a text. .DataValueField("TemplateCategoryID") //Specifies which property of the Product to be used by the combobox as a value. .Filter(FilterType.Contains) .DataSource(source => { source.Read(read => { read.Action("GetTemplateCategories", "Console"); //Set the Action and Controller name }); }) .SelectedIndex(0) //Select first item.)public ActionResult GetTemplateCategories(){ string baseAddress = string.Format(ConfigurationManager.AppSettings["MarketingServiceAddress"] + "GetTemplateCategories"); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(baseAddress); request.Method = "GET"; request.ContentType = "text/plain"; using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { int statusCode = (int)response.StatusCode; StreamReader reader = new StreamReader(response.GetResponseStream()); string results = reader.ReadToEnd(); return Json(results, JsonRequestBehavior.AllowGet); }}$(
"#openButton").click(function () {
var window1 = $("#window").kendoWindow({
content: "Test.html",
title: " Window Content",
modal: true });
var window = $("#window").data("kendoWindow");
window.center();
window.open(); });
Thanks in advance.