ReferencePath Property

Sets or returns a reference to a user control (.ascx file). The default value is null.

public string ReferencePath {
   get,
   set
}

Remarks

The style sheet on the page inherits the styles in a style sheet defined at the root level of the referenced user control. For example, if the style sheet on the user control has a property named Style1, the page can access Style1 as if it were in the style sheet on the page.

Example

The following example demonstrates how to use the ReferencePath property to specify a user control containing a style sheet.

// Code  in an .aspx file.
<Mobile:StyleSheet id="Style1" ReferencePath="Mobile_style.ascx"
    runat="server" />
<mobile:Form id=WelcomeForm runat="server" stylereference="Style1"    
    title="Welcome" >
   <mobile:label runat=server Text=" Welcome " stylereference="title" />
</mobile:Form>

// Mobile_style.ascx ( external stylesheet ).

<Mobile:Stylesheet runat=server>
    <Style name="Style1">
        <DeviceSpecific>
          <Choice Filter="isHTML32">
            <HeaderTemplate>
                //Add Code and controls
            </HeaderTemplate>
            <FooterTemplate>
                //Add Code and controls
            </FooterTemplate>
           </Choice>
        </DeviceSpecific>
    </Style>
</Mobile:Stylesheet>  

See Also

Applies to: Stylesheet Class