Get Stylesheet control to work in ASCX RRS feed

  • Question

  • User2098947605 posted

    I'm trying to get the Mobile Stylesheet control to work in a User Control, per the documentation but it just isn't.  Works fine when I place the styles in the Stylesheet control on the ASPX, but when I set the ReferecnePath of the ASPX Stylesheet control to the ASCX that contains the styles it doesn't work.  Anyone know what the trick is?

    Here's my code. 

    The page contains:

    <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
     <mobile:stylesheet id="StyleSheet1" runat="server" ReferencePath="styles.ascx">
     <mobile:form id="Form1" title="Vendors" runat="server">
      <mobile:Label id="Label1" runat="server" StyleReference="lbl">ID</mobile:Label>

    styles.ascx contains:

    <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
    <%@ Control Language="vb" AutoEventWireup="false" Codebehind="styles.ascx.vb" Inherits="MobileWebApplication1.styles" TargetSchema="http://schemas.microsoft.com/Mobile/WebUserControl" %>

    <mobile:StyleSheet id="StyleSheet1" runat="server" >
     <mobile:Style Name="lbl" ForeColor="navy" Font-Bold="True" Alignment="Right"></mobile:Style>
     <mobile:Style Name="cmd" BackColor="navy" ForeColor="white" Font-Bold="True"></mobile:Style>
     <mobile:Style Name="lnk" Alignment="Center"></mobile:Style>
     <PagerStyle Name="pgr" BackColor="navy" ForeColor="yellow" Font-Bold="True"></PagerStyle>

    Thanks<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Vendor.aspx.vb" Inherits="MobileWebApplication1.Vendor" %>

    Thursday, June 21, 2007 5:33 PM

All replies

  • User113421904 posted


    What is MobileWebApplication1.styles? It seems Inherits="MobileWebApplication1.styles" might be the issue.

    Monday, June 25, 2007 5:24 AM