我試圖做一個TextBox
自動建議,我用Ajax
控件來做到這一點。我正在給電影排列一些價值。我想通過使用用戶用來登錄網站的電子郵件ID過濾用戶表,從數據庫中提供該值。我無法將標籤值調用到下面的方法中。我在頁面加載過程中將用戶的電子郵件ID存儲在標籤中。幫助我做到這一點。AutoSuggest在一個asp.net使用Ajax控件
[System.Web.Services.WebMethodAttribute(),System.Web.UI.WebControls, System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int count, string contextKey)
{
// Create array of movies
string[] movies = {"Joey", "Joester", "Joker", "Joeic", "Joic", "Shrek II"};
// Return matching movies
return (from m in movies where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
}
標籤存儲登錄到系統的用戶的電子郵件ID。我需要該值來檢索數據庫中的值 – rookie
請參閱最新的答案。 –