PC Review


Reply
 
 
shapper
Guest
Posts: n/a
 
      29th May 2007
Hello,

On a class I am defining the CssClass of a control at runtime.
However, I would also like to create the CssClass at runtime. Is this
possible?

Something like:
Dim myCssClass="clear:both; color: #FFFFFF"
MyControl.CssClass = myCssClass

Thanks,
Miguel

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      29th May 2007
CssClass is the html class attribute and should be the name of a style
class, not a style command.

you can render the style commands at runtime.

-- bruce (sqlwork.com)


shapper wrote:
> Hello,
>
> On a class I am defining the CssClass of a control at runtime.
> However, I would also like to create the CssClass at runtime. Is this
> possible?
>
> Something like:
> Dim myCssClass="clear:both; color: #FFFFFF"
> MyControl.CssClass = myCssClass
>
> Thanks,
> Miguel
>

 
Reply With Quote
 
=?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
Guest
Posts: n/a
 
      30th May 2007
Sure:

Dim myCssClassName As String ="myCSS"
Dim myCssClassDefinition As String = "clear:both; color: #FFFFFF"
Dim ltrl As Literal = New Literal
ltrl.Text = String.Format("<{0} type='text/css'>.{1} {{{2}}}</{0}>",
"style", myCssClassName , myCssClassDefinition)
Me.Page.Header.Controls.Add(ltrl)

' and then assign your class to controls:
MyControl.CssClass = myCssClassName

"shapper" wrote:

> Hello,
>
> On a class I am defining the CssClass of a control at runtime.
> However, I would also like to create the CssClass at runtime. Is this
> possible?
>
> Something like:
> Dim myCssClass="clear:both; color: #FFFFFF"
> MyControl.CssClass = myCssClass
>
> Thanks,
> Miguel
>
>

 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      30th May 2007
On May 29, 11:50 pm, shapper <mdmo...@gmail.com> wrote:
> Hello,
>
> On a class I am defining the CssClass of a control at runtime.
> However, I would also like to create the CssClass at runtime. Is this
> possible?
>
> Something like:
> Dim myCssClass="clear:both; color: #FFFFFF"
> MyControl.CssClass = myCssClass
>
> Thanks,
> Miguel


http://groups.google.com/group/micro...200e6aec7f6062

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using cssclass with CSS IDs DamienS Microsoft ASP .NET 4 14th Jul 2008 03:22 AM
cssClass and ID same name rodchar Microsoft ASP .NET 2 31st Mar 2008 05:26 PM
Id and CssClass not defined shapper Microsoft ASP .NET 3 30th Dec 2007 02:48 AM
Changing the CssClass for a <TD> Larry Bud Microsoft ASP .NET 6 4th Jan 2007 07:47 PM
Accessing cssclass Rodney Microsoft Dot NET 1 22nd Nov 2003 04:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:10 AM.