On my aspx page, I have a dropdownlist and a user control that is used twice (ucA and ucB). If the dropdownlist changes then ucA and ucB have to be changed. Also, if ucA has any changes to it, then ucB has to be changed. I figured out the code for the dropdown list so if it changes ucA and ucB get changed as well. I'm having a difficult time figuring out the code to create a SelectedIndexChanged event for the user control. Here is the code that I have on the code-behind in the user control:
public class IndexChangedEventArgs : EventArgs
{
}
public delegate void IndexChangedEventHandler(object sender, IndexChangedEventArgs e);
public class IndexChangedEvent
{
public event IndexChangedEventHandler IndexChanged;
protected virtual void OnIndexChanged(IndexChangedEventArgs e)
{
if (IndexChanged != null)
{
//Invokes the delegates.
IndexChanged(this, e);
}
}
}
I'm not sure how to raise the IndexChanged event in the user control and how to call the user control's IndexChanged event from the aspx page. Also, any good links that explain how to do this will be appreciated.
Thanks for the help!
public class IndexChangedEventArgs : EventArgs
{
}
public delegate void IndexChangedEventHandler(object sender, IndexChangedEventArgs e);
public class IndexChangedEvent
{
public event IndexChangedEventHandler IndexChanged;
protected virtual void OnIndexChanged(IndexChangedEventArgs e)
{
if (IndexChanged != null)
{
//Invokes the delegates.
IndexChanged(this, e);
}
}
}
I'm not sure how to raise the IndexChanged event in the user control and how to call the user control's IndexChanged event from the aspx page. Also, any good links that explain how to do this will be appreciated.
Thanks for the help!