Kendo ui AutoComplete with C# simple source

CH

New Member
I try to use the Kendo UI Autocomplete tool with a C# datasource.It seems very easy in PHP:\[code\] <?php include("connection.php"); $arr = array(); $stmt = $db->prepare("SELECT StateID, StateName FROM USStates WHERE StateName LIKE ?"); // get the StartsWith value and append a % wildcard on the end if ($stmt->execute(array($_GET["StartsWith"]. "%"))) { while ($row = $stmt->fetch()) { $arr[] = $row; } } // add the header line to specify that the content type is JSON header("Content-type: application/json"); echo "{\"data\":" .json_encode($arr). "}";?>\[/code\]But I want to use a CSHtml file or something equivalent, do you have any idea on how to accomplish this?I don't want to create a controller attached with a model, etc... If it's possible to make it with only one page, it would be great.
 
Back
Top