无法通过Jquery UI自动完成显示表属性 [英] Unable to display a table properties through Jquery UI Autocomplete
本文介绍了无法通过Jquery UI自动完成显示表属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的控制器。
This is my controller.
public class HomeController : Controller
{
string commString = "";
public HomeController()
{
FWUtility.connString = "Data Source = DEVELOPER1; Initial Catalog = FR8DemoDB; uid=sa; pwd=123;";
}
public ActionResult Index()
{
commString = "select BrandID, BrandName from BrandMaster order by BrandName";
List<BrandMaster> listBrandMaster = FWUtility.GetList<BrandMaster>(FWUtility.GetDataTable(commString));
var str = FWUtility.GetJson(listBrandMaster);
return View(str);
}
}
public class BrandMaster
{
public string BrandID { get; set; }
public string BrandName { get; set; }
}
}
这是我的看法。
This is my view.
@using System.Data;
@using JqeryUiAutoCompleteOnClickDisplayBrandIdOfBrandName.Controllers;
@model string
<script type="text/javascript">
$(document).ready(function () {
myFunction();
});
function myFunction() {
$.ajax({
url: "../Home/Index",
dataType: 'json',
$("#tags").autocomplete({});
});
}
</script>
<body>
<div>
<input id="tags">
</div>
</body>
它给了我错误,路径中的非法字符 。我想通过Jquery自动完成控件显示 BrandName 。我从昨天开始尝试这个。 Plesae帮助。
It is giving me error ,"Illegal characters in path". I want to display the "BrandName" through the Jquery autocomplete control. I have been trying this from yesterday. Plesae help.
推荐答案
(document).ready(function(){
myFunction();
});
函数myFunction(){
(document).ready(function () { myFunction(); }); function myFunction() {
.ajax({
url:../ Home / Index,
dataType:'json',
.ajax({ url: "../Home/Index", dataType: 'json',
(#tags)。autocomplete({});
});
}
< / script>
< body>
< div>
< input id =tags>
< / div>
< / body>
("#tags").autocomplete({}); }); } </script> <body> <div> <input id="tags"> </div> </body>
它给了我错误,路径中的非法字符 。我想通过Jquery自动完成控件显示 BrandName 。我从昨天开始尝试这个。 Plesae帮助。
It is giving me error ,"Illegal characters in path". I want to display the "BrandName" through the Jquery autocomplete control. I have been trying this from yesterday. Plesae help.
这篇关于无法通过Jquery UI自动完成显示表属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文