Applying CSS on mobile controls

ASP.NET

Applying CSS on mobile controls

Postby a2V5dXI0NzgzMQ » Thu, 26 Jul 2007 23:42:04 GMT

i am facing trouble in applying stylesheets on mobile controls. I want to 
give background color to a label but its not rendering. Can any one please 
help me..??

Re: Applying CSS on mobile controls

Postby arnie » Wed, 15 Aug 2007 17:56:20 GMT

Hi
You can make use of mobile web user control to create a style sheet
like this
1. Add a new mobile web user control to the project.
2. Add code to the file like this



<mobile:StyleSheet ID="StyleSheet1" Runat="server" >
<mobile:Style Name="style1" Font-Name="Verdana" BackColor="#0099cc"
Font-Size="normal" Font-Bold="true" ></mobile:Style>
<mobile:Style Name="Button"></mobile:Style>
</mobile:StyleSheet>
3.Save it.
4. In the mobile web form where you want to apply this style sheet add
this
<mobile:StyleSheet ID="StyleSheet1" Runat="server" ReferencePath="css
\StyleSheet.ascx"></mobile:StyleSheet>

In each mobile control there is a propery called StyleReference where
you can specify one of the style names present in the external style
sheet created above

Hope this helps
Arnie


Similar Threads:

1.apply CSS on literal control?

Hello

I use Microsoft Office Webcomponents to create a pivottable and display the
output as HTML on a literal control.

I need to apply a CSS to this literal control, because the HTML data is
already formatted by the OWC pivottable object...

(simplified) code:

MyLiteralcontrol.text = MyOWCPivottable.HTMLData

The pivottable displays, but doesn't look the way I like it (font, borders
etc)

Any suggestions on how to do this?

Thanks,

Joost


2.Applying CSS to HTML Control Programatically

I am using HTML controls in my page i want to Programatically apply CSS for
that controls as that of contorol.CSS="cssname" for Web Control. How to do
it?.

Thanks in Advance
Prakash.V


3.how to apply css class style to web controls

i am using web control in my project .how to apply css style to the web control

4.applying css formats to asp.net 2.0 treeview control

Hi all,

I'm trying to create a nice navigation for an asp.net 2.0 website.
What I want to do is use css to define the look of the tree. My
problem is that I cannot set margins or paddings via css. I want to
create a gap between top-level nodes, however not between a top-level
node and its first child (which I set always visible). I defined css
classes like "navi_level0", "navi_level1", ... in my css file and set
the CssClass properties in the corresponding TreeNode's LevelStyles.
Applying colors, font-sizes etc. works fine, but since the TreeView
control does only render my previously defined css classes to the <td>
elements and not to any enclosing <div> or <table> tags, I remain
helpless with css since I can define margin only for <table> and <div>
tags.
My next approach was using the VerticalPadding, NodeSpacing and Height
properties of the corresponding LevelStyle. But here, the value is
applied both at the top and at the bottom of the element, rendering a
gap above AND below each top-level node. Is there any workaround or is
this control not css formattable?
Would it be possible to create a custom class derived from the
TreeView class?
Thanks in advance.

Cheers, Hannes.

5.Applying new style for mobile control

Hi,

I'm trying create new style property for mobile panel control and getting 
following error:
Specified cast is not valid
Line 21: 			set
Line 22: 			{
Line 23: 				this[DirectionKey] = value;
Line 24: 			}

Here is my code(just like in msdn site)
public class StyleWithRtl : Style
	{
		public static String DirectionKey = 
		RegisterStyle("Direction", typeof(String), string.Empty, true).ToString();

		
		public String Direction
		{
			get
			{
				return (String)this[DirectionKey];
			}
			set
			{
				this[DirectionKey] = value;
			}
		}


	}

Any help?
thanks,
Eugene

6. LinkButton in GridView TemplateField not applying a:visited css st

7. applying CSS using Custom Attributes

8. Applying CSS for gridview template column



Return to ASP.NET

 

Who is online

Users browsing this forum: No registered users and 28 guest