We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Applying CSS in ASP.net Mobile

mkdev2009
mkdev2009 asked
on
Medium Priority
2,007 Views
Last Modified: 2012-05-06
Hi Experts,
I'm new in ASP.net Mobile .
I'm currently converting my ASP.net web portal to ASP.net Mobile WAP portal and i'm facing problem on applying  the CSS that i'm using in web page into WAP page.
Can anyone help?

Thanks.
Comment
Watch Question

Dirk HaestProject manager
CERTIFIED EXPERT
Commented:
Support Mobile Devices in ASP.NET (Advances Topics)
- How to customize mobile pages by Device Type
- Using Cascading Style sheets in mobile pages
- Developing User Friendly Mobile Pages:

http://www.beansoftware.com/ASP.NET-Tutorials/CSS-Mobile-Device.aspx

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
This should help:
http://www.developershome.com/wap/wcss/wcss_tutorial.asp?page=introduction
http://www.nic.fi/~tapio1/Teaching/WAP.php3

I have also attached a documentation on using CSS for WAP.

I hope this helps.

Good luck

MD
WAP-239-WCSS-20011026-a.pdf

Author

Commented:
Hi guys..
thanks for help, i currently able to use the style sheet by insert the style sheet code at the top of my mobile form but i more prefer to use external style sheet so that i can use the same style sheet at every wap page.

Anyone know how to create external style sheet?
Dirk HaestProject manager
CERTIFIED EXPERT

Commented:
How to include External css file in Mobile Application
http://forums.asp.net/t/1357842.aspx

Author

Commented:
I have created an external style sheet in mobile User Control. I include the style sheet by dragging the .ascx file into the WAP page.

However, i this error:
 ---------------------------------------------------------------------------------------------------------------------------
"Style not found: style1
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Style not found: style1"
----------------------------------------------------------------------------------------------------------------------------

Below are my code :
----------------------------------------------------------------------------------------------------------------------------
%@ Page Language="C#" AutoEventWireup="true" CodeFile="Reservation1.aspx.cs" Inherits="Reservation_Reservation1" %>

<%@ Register Src="../mStyle.ascx" TagName="mStyle" TagPrefix="uc2" %>

<%@ Register Src="../UserControl/AAUserControl.ascx" TagName="AAUserControl" TagPrefix="uc1" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>



   


   
        &nbsp;mobile.airasia.com  
           
           
         AirAsia Home &nbsp;


------------------------------------------------------------------------------------------------------------------------------

Author

Commented:
This is my content in my ASCX page
------------------------------------------------------------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mStyle.ascx.cs" Inherits="mStyle" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
  <mobile:StyleSheet Runat="server" ID = "CSS">
       <mobile:Style name ="style1" Font-Name ="Arial" BackColor= "#3399ff"  Font-Size="Large" />
   </mobile:StyleSheet>

Author

Commented:
any one know why i get this error?

Style not found: style1
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Style not found: style1"
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.