Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
<%@ master language="C#" autoeventwireup="true" codebehind="Main.master.cs" inherits="Main.templates.MasterPages.Main"> <%@ register tagprefix="bws" tagname="Branches" src="~/templates/Units/Branches.ascx">Untitled Page
Branches.ascx =============<%@ control language="C#" autoeventwireup="true" codebehind="Branches.ascx.cs" inherits="Main.templates.Units.Branches">
Branches.ascx.cs =============using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using EPiServer; using EPiServer.Core; namespace Main.templates.Units { public partial class Branches : UserControlBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataBind(); ddlRegionBranches.DataValueField = "LinkURL"; ddlRegionBranches.DataTextField = "PageName"; ddlRegionBranches.DataSource = my_data_source_that_works; ddlRegionBranches.DataBind(); ddlRegionBranches.Items.Insert(0, "Välj anläggning"); ddlRegionBranches.SelectedIndex = 0; } } protected void ddlRegionBranches_SelectedIndexChanged(object sender, EventArgs e) { Response.Redirect(ddlRegionBranches.SelectedValue); } } }
StartPage.aspx =============== Just an empty aspx file that inherits from EPiServer.TemplatePage Thank you! Jonas