Dynamically creating <style type="text/css">

Discussion in 'ASP .Net' started by Amil Hanish, Aug 1, 2006.

  1. Amil Hanish

    Amil Hanish Guest

    I want to dynamically create the <style> tag. I know I can simply add a
    "runat" direction and set the inner value.

    But, I was curious if there was a more object-based way in .NET to do this.
    For example, can I create a collection of things like body, a, table, td,
    tr, etc and associate different style attributes to each one individually;
    then have .NET automatically render them for me (or even iterate over them
    myself). Thanks.

    Amil
    Amil Hanish, Aug 1, 2006
    #1
    1. Advertising

  2. Hi Amil,

    If you haven't already done so, you might want to check out the
    CreateStyleRule method shown here:

    http://msdn2.microsoft.com/en-us/library/system.web.ui.istylesheet.createstylerule.aspx

    Ken
    Microsoft MVP [ASP.NET]


    "Amil Hanish" <> wrote in message
    news:%...
    >I want to dynamically create the <style> tag. I know I can simply add a
    >"runat" direction and set the inner value.
    >
    > But, I was curious if there was a more object-based way in .NET to do
    > this. For example, can I create a collection of things like body, a,
    > table, td, tr, etc and associate different style attributes to each one
    > individually; then have .NET automatically render them for me (or even
    > iterate over them myself). Thanks.
    >
    > Amil
    >
    Ken Cox [Microsoft MVP], Aug 1, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Roberts
    Replies:
    2
    Views:
    10,836
    Rob Roberts
    Jan 21, 2006
  2. heyo
    Replies:
    3
    Views:
    885
    Dan Pop
    Apr 1, 2004
  3. pete
    Replies:
    4
    Views:
    782
    Dan Pop
    Apr 2, 2004
  4. Yevgen Muntyan

    #define ALLOCIT(Type) ((Type*) malloc (sizeof (Type)))

    Yevgen Muntyan, Feb 9, 2007, in forum: C Programming
    Replies:
    10
    Views:
    881
    Yevgen Muntyan
    Feb 13, 2007
  5. Ken Varn
    Replies:
    0
    Views:
    428
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page