Hi,
I have a Cloud ASP.Net project which requires the use of a textbox with autocomplete (from AjaxControlToolkit). The autocompletion works well on a page A (homepage). However, if i go to this page A after a redirection (Response.Redirect), the autocompletion doesn't work.
I created a new project to isolate this problem. The autocomplete works well after a redirection on a classic ASP.Net website but not on a Cloud Project.
Someone would have an idea ? Here is the code of the project.
Thanks !
-------------------------- Test1.aspx -----------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="WebRole1.Test1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajc" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ajc:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
<asp:TextBox ID="tbFournisseur" runat="server"></asp:TextBox>
<ajc:AutoCompleteExtender
ID="aceTbFournisseur"
TargetControlID="tbFournisseur"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="2"
EnableCaching="true"
CompletionSetCount="1"
CompletionInterval="1000"
runat="server" UseContextKey="True" />
</div>
</form>
</body>
</html>
-------------------------------------------- Test1.aspx.cs -------------------------------------
namespace WebRole1
{
public partial class Test1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int count, string contextKey)
{
// Create array of movies
string[] movies = { "Star Wars", "Star Wars 3", "Superman", "Memento", "Shrek", "Shrek II" };
// Return matching movies
return (from m in movies where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
}
}
}