Trigger an ImageClick from a selecteditemchanged changed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys

I have a search system with a textbox and an image button. You click the
image to perform the search. Works fine.

However, the matter is complicated by a drop down list, which gives you a
number of search options (search cotacts, search projects, etc).

Basically, I want to call the search function from the onchange event of the
drop down. I could write the search code into 2 functions, but I just
wondered if there was an easier way?

At the moment both function want different EventArgs
(System.Web.UI.ImageClickEventArgs and System.EventArgs).

Any ideas?

Cheers



Dan
 
Make on general function that both events call

void OnImageClick(object sender, System.Web.UI.ImageClickEventArgs e)
{
PerformSearch(MyTextBox.Text);
}

void OnDropDownChanged(object sender, EventArgs e)
{
PerformSearch(MyTextBox.Text);
}

void PerformSearch(string str)
{
//Common code goes here
}


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top