I want to get the e.result before it pumps data into my listbox..I want to check whether the e.result is null or have value..
My coding is like this
public Page1(string s)
{
InitializeComponent();
Service1Client proxy = new Service1Client();
proxy.FindEmployeeCompleted += new EventHandler<FindEmployeeCompletedEventArgs>(proxy_FindEmployeeCompleted);
proxy.FindEmployeeAsync(s);
}
void proxy_FindEmployeeCompleted(object sender, FindEmployeeCompletedEventArgs e)
{
if(e.Result!=null)
{
listBox1.ItemsSource = e.Result;
}
else
{
MessageBox.Show("Invalid username or password.");
}
}
but after i execute my coding, the message box didn’t show up…
Is it i miss out any code?
1 Answer