My master page has a drop down list of languages. When the user
selects a new language, I would like to call a method in the currently
loaded content page to load all the fields with text in the chosen
language. My current approach is in the Content page to hook into the
SelectedIndexChange event of the dropdown list (ID is ddlLanguage), but
I am not receiving the event (see code below). Is there a better way
to do this? Alternately, could I handle the event in the master page
codebehind and call a method in the currently loaded page? There will
be several content pages, so they would all support the method.
Thanks in advance,
JPan
// Page_Load() on Content page
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
// all this code seems to work without a problem
langDDL = (DropDownList) Master.FindControl("ddlLanguage");
langDDL.SelectedIndexChanged += new
EventHandler(langDDL_SelectedIndexChanged);
}
}
// Event handler - also on Content page (not being called!)
public void langDDL_SelectedIndexChanged(object sender, EventArgs
e)
{
// set UI culture, change text of each control, etc.
}