2011-12-01 132 views
0

我沒上http://volaresystems.com/Blog/post/Autocomplete-dropdown-with-jQuery-UI-and-MVC.aspx
提到的一切,但我沒有什麼,當我在我的文本框JQuery的測試失敗...需要解決

我的形式

<%using (Html.BeginForm("")) %> 
<%:Html.TextBox("completeMe","name") %> 
<%:Html.TextBox("completeMe","ID") %> 
<input type="submit" value="submit"/> 
<%} %> 

大會鍵入AZ

<link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> 
<link href="../../Content/themes/base/jquery.ui.all.css" /> 
<link href="../../Content/themes/base/jquery.ui.autocomplete.css" type="text/css" /> 
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> 
<script src="../../Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script> 
<script src="../../Scripts/jquery.autocomplete.js" type="text/javascript"></script> 
<script src="../../Scripts/jquery-ui-1.8.16.min.js"type="text/javascript"></script> 
+0

我們展示您的代碼,請。 – talnicolas

+6

你不能指出一個正確的實現,並說你已經完成了所有這些。 *顯然*如果他們的版本正在工作,則有些不同,而你的版本不是。向我們展示您的完整代碼,或許更重要的是,告訴我們您的錯誤:發生時,以及確切的錯誤消息。 –

+0

是的,你是對的大衛。我試圖在這裏上傳我的代碼//但是無法正確地填寫它 – RollerCosta

回答

1

我做了一切提到的 http://volaresystems.com/Blog/post/Autocomplete-dropdown-with-jQuery-UI-and-MVC.aspx

我看不到在您所做的腳本包含和文章中提到的腳本包含之間有許多共同之處。你已經包含了兩次jQuery UI。你也可以使用url助手來硬編碼你的url,如文章中所示。另外,您正在使用不同版本的jQuery和jQuery UI,因此請確保這些腳本在腳本文件夾中可用。因此,嘗試以下操作:

<link href="<%= Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css" /> 
<link href="<%= Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" /> 
<link href="<%= Url.Content("~/Content/themes/base/jquery.ui.autocomplete.css") %>" type="text/css" /> 

<script src="<%= Url.Content("~/Scripts/jquery-1.7.1.min.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/jquery-ui-1.8.16.min.js") %>" type="text/javascript"></script> 

然後在你的瀏覽器中打開你的JavaScript調試工具,看看如果你沒有得到一些JavaScript錯誤,錯誤的URL路徑,...