Forums Neueste Beiträge
 

Ajax dynamisch einbinden

08/04/2008 - 11:23 von hugomind | Report spam
Hallo,

Ich hab das hier versucht, aber leider klappt das nicht :

[System.Web.Services.WebMethodAttribute(),
System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int
count, string contextKey)
{
return new string[] { "Audi", "BMW" };
}

protected void Button1_Click(object sender, EventArgs e)
{
TextBox txtbA = new TextBox();
txtbA.Width = 100;
txtbA.Height = 20;
txtbA.ID = "txtbA";

AjaxControlToolkit.AutoCompleteExtender ajaxAC_A = new
AjaxControlToolkit.AutoCompleteExtender();
ajaxAC_A.ID = "ajaxAC_A";
ajaxAC_A.TargetControlID = "txtbA";
ajaxAC_A.MinimumPrefixLength = 1;
ajaxAC_A.ServiceMethod = "GetCompletionList";
ajaxAC_A.UseContextKey = true;

form1.Controls.Add(txtbA);
}


Weiss jemand warum ?

Danke

Hugo
 

Lesen sie die antworten

#1 hugomind
08/04/2008 - 11:33 | Warnen spam
On Apr 8, 11:23 am, hugomind wrote:
Hallo,

Ich hab das hier versucht, aber leider klappt das nicht :

[System.Web.Services.WebMethodAttribute(),
System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int
count, string contextKey)
{
return new string[] { "Audi", "BMW" };
}

protected void Button1_Click(object sender, EventArgs e)
{
TextBox txtbA = new TextBox();
txtbA.Width = 100;
txtbA.Height = 20;
txtbA.ID = "txtbA";

AjaxControlToolkit.AutoCompleteExtender ajaxAC_A = new
AjaxControlToolkit.AutoCompleteExtender();
ajaxAC_A.ID = "ajaxAC_A";
ajaxAC_A.TargetControlID = "txtbA";
ajaxAC_A.MinimumPrefixLength = 1;
ajaxAC_A.ServiceMethod = "GetCompletionList";
ajaxAC_A.UseContextKey = true;

form1.Controls.Add(txtbA);
}

Weiss jemand warum ?

Danke

Hugo



Danke habs, und so geht's :


protected void Button1_Click(object sender, EventArgs e)
{
TextBox txtbA = new TextBox();
txtbA.Width = 100;
txtbA.Height = 20;
txtbA.ID = "txtbA";

AjaxControlToolkit.AutoCompleteExtender ajaxAC_A = new
AjaxControlToolkit.AutoCompleteExtender();
ajaxAC_A.ID = "ajaxAC_A";
ajaxAC_A.TargetControlID = "txtbA";
ajaxAC_A.MinimumPrefixLength = 1;
ajaxAC_A.ServiceMethod = "GetCompletionList";
ajaxAC_A.UseContextKey = true;
ajaxAC_A.CompletionInterval = 1000;
ajaxAC_A.CompletionSetCount = 10;
ajaxAC_A.EnableCaching = true;
ajaxAC_A.FirstRowSelected = false;

ajaxAC_A.Enabled = true;

form1.Controls.Add(txtbA);
form1.Controls.Add(ajaxAC_A);

}

Ähnliche fragen