I am converting an aspx website from separate aspx language pages (utilizing the same code behind) to one main aspx with user controls. I have one user control ascx file for each language, all with the same IDs in them so the same code behind can be used for any of them. How can I conditionalize which one gets displayed to the user without running into compile issues?
use session variable Session["lang"] This is what I have:
<%@ Register TagPrefix="section" TagName="account" Src="account.ascx" %>
<%@ Register TagPrefix="section" TagName="account_span" Src="account_span.ascx" %>
EDIT: Solution This is what I ended up using in the .aspx
<asp:PlaceHolder ID="PlaceHolder_section" runat="server" />
and what I have in the code-behind: section variable hold each section name and suffix is the language
PlaceHolder_section.Controls.Add(this.LoadControl(section + suffix + ".ascx"));