gjshah7254
5/19/2015 - 4:01 AM

Declare a variable in code behind and retrieve value in aspx

Declare a variable in code behind and retrieve value in aspx

ASPX File code
  <%= HeaderCssClass %>
  
Code Behing Code
  public string HeaderCssClass {
        get {
                return "dark";
            }
        }
    
    
Kentico Get Background CSS Class Dynamically in ASPX Template
ASPX Code:
<%= BackgroundCssClass %>

Code Behind Code:
     public ControlCollection ControlsCollection
        {
            get { return Page.Controls; }
        }

        public string BackgroundCssClass { get; set; }