StyleSheets and Mobile Web Forms RRS feed

  • Question

  • User-98531490 posted

    #1 Question 

    I like the fact that Mobile Web Forms are availible in VS2005. However it seems a huge disadvantage to use the since you are limited on tools and functionality. I am trying to use StyleSheet control on these pages that have the same characteristics as the ones on the main non mobile webpage.

        <Mobile:Style Name="title" ForeColor="Blue" Font-Bold="True" Font-Name="Tahoma" Font-Size="Small" />
        <PagerStyle Name="myBackColor" BackColor="red" />
        <PagerStyle Name="myForeColor" ForeColor="Black" Font-Name="Tahoma" Font-Size="Small" />

     In the above example you need a new line for all variations of the CSS. If I use a PageStyle and the use a Style (not a PageStyle) it overrides all the PageStyle. So I need to create a Style that is the same as the PageStyle if I want to use a Style. In a normal page CSS file it takes the page styles and only makes the changes that are the same between the two. Style seems to cancel out the entire PageStyle when you associate a Style to a Label, TextBox, etc and only changes the style you specify in Style. Below if you use myTitle you would lose Font-Name="Tahoma" Font-Size="Small". I may be doing something wrong so please take that into consideration.

       <Mobile:Style Name="myTitle" ForeColor="Blue" Font-Bold="True" />
        <PagerStyle Name="myForeColor" ForeColor="Black" Font-Name="Tahoma" Font-Size="Small" />

    #2 Question

    I seen an example where you could put all of your styles in a .ASCX file and use a ReferencePath from the actual page to use the styles there so you could use it in multiple pages but have not seemed to get this to work yet.

    #3 Question

    With the lack of tools, capabilities and headache of using Mobile Web Forms why would someone not just sipmle create a normal page and just make a table to the specific size you need for your application?

    Friday, June 29, 2007 11:47 AM

All replies

  • User-1573490007 posted

    I'm not sure about your other questions since I didn't work with styles in mobile web form, since all I had to do was fairly simple things, but the answer to #3 is easy: Some mobile devices can't read HTML. Different devices have different capabilities. You'd almost need 1 web page per device, and that is counter productive.

    If you're making a web page for mobile devices, and by mobile devices, your client means "Windows Mobile and thats it", then sure, go for it and make a normal web page. But if you have to support the largest possible range of mobile devices, the mobile web forms are by far your best bet.

    Friday, June 29, 2007 12:01 PM
  • User-98531490 posted

    Thanks for the quick reply. I do understand that different devices have different capabilities. Like you most of my apps are pretty simple but can span many pages so I did not want to have to change fonts colors and when not on every page as well as come back and update every page if I make a change. Most of the people viewing this will be internal sorry left that out. I agree if you are going to the masses you would be best to use something that would give you more bang for your buck.

     Still looking for and answer for Question 1 and 2

    Friday, June 29, 2007 2:23 PM
  • User113421904 posted


    For the question 2. Can you tell me where did you find your example? There is example of ReferencePath on MSDN:


    Try this. Hope it help.

    Wednesday, July 4, 2007 1:50 AM