O
Oitne.Inside
Hi there,
I'm trying to make a basic app in asp.net written in C#. I managed to
get it working in a appliaction, but when i make inside an
webapplication, it wont work. Any ideas?
private void Nameserver_SignedIn(object sender, EventArgs e)
{
UpdateContactListDelegate updateListBox = new
UpdateContactListDelegate(this.UpdateContactList);
--> ListBox1.Invoke(updateListBox);
}
public delegate void UpdateContactListDelegate();
private void UpdateContactList()
{
ListBox1.Items.Clear();
System.Windows.Forms.MessageBox.Show("D");
foreach (Contact contact in msn.ContactList.All)
{
this.ListBox1.Items.Add("C: " + contact.Name);
}
}
The problem occures at "ListBox1.Invoke(updateListBox);". I have to
invoke it couse it goed cross threading. The error i get is
"System.Web.UI.WebControls.ListBox' does not contain a definition for
'Invoke"
I'm trying to make a basic app in asp.net written in C#. I managed to
get it working in a appliaction, but when i make inside an
webapplication, it wont work. Any ideas?
private void Nameserver_SignedIn(object sender, EventArgs e)
{
UpdateContactListDelegate updateListBox = new
UpdateContactListDelegate(this.UpdateContactList);
--> ListBox1.Invoke(updateListBox);
}
public delegate void UpdateContactListDelegate();
private void UpdateContactList()
{
ListBox1.Items.Clear();
System.Windows.Forms.MessageBox.Show("D");
foreach (Contact contact in msn.ContactList.All)
{
this.ListBox1.Items.Add("C: " + contact.Name);
}
}
The problem occures at "ListBox1.Invoke(updateListBox);". I have to
invoke it couse it goed cross threading. The error i get is
"System.Web.UI.WebControls.ListBox' does not contain a definition for
'Invoke"