need help on easy ASP.NET question

Discussion in 'ASP .Net' started by msnnews.msn.com, Jan 14, 2005.

  1. hi there,

    i have the following code on my ASPX page..:

    <LINK id="myCSS" runat="server" href="../print.css" type="text/css"
    rel="stylesheet" />

    how do i reference this in the behind VB code so i can make the HREF
    dynamic?

    thanks,
    Paul
    msnnews.msn.com, Jan 14, 2005
    #1
    1. Advertising

  2. msnnews.msn.com

    Karl Seguin Guest

    protected myCSS as HtmlControls.HtmlGenericControl


    myCss.Attributes.Add("Href", "styles.css")


    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "msnnews.msn.com" <> wrote in message
    news:OKFWajk%...
    > hi there,
    >
    > i have the following code on my ASPX page..:
    >
    > <LINK id="myCSS" runat="server" href="../print.css" type="text/css"
    > rel="stylesheet" />
    >
    > how do i reference this in the behind VB code so i can make the HREF
    > dynamic?
    >
    > thanks,
    > Paul
    >
    >
    Karl Seguin, Jan 14, 2005
    #2
    1. Advertising

  3. msnnews.msn.com

    Milsnips Guest

    thanks heaps:))

    "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
    wrote in message news:OWXKFqk%...
    > protected myCSS as HtmlControls.HtmlGenericControl
    >
    >
    > myCss.Attributes.Add("Href", "styles.css")
    >
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    > "msnnews.msn.com" <> wrote in message
    > news:OKFWajk%...
    >> hi there,
    >>
    >> i have the following code on my ASPX page..:
    >>
    >> <LINK id="myCSS" runat="server" href="../print.css" type="text/css"
    >> rel="stylesheet" />
    >>
    >> how do i reference this in the behind VB code so i can make the HREF
    >> dynamic?
    >>
    >> thanks,
    >> Paul
    >>
    >>

    >
    >
    Milsnips, Jan 14, 2005
    #3
  4. msnnews.msn.com

    David Jessee Guest

    Try this.

    <LINK id="myCSS" runat="server" href='<% = CssPath %>' type="text/css"
    rel="stylesheet" />

    in your code behind....

    Protected Readonly Property CssPath
    Get
    Reutrn "../print.css" ' or whatever
    End Get
    End Property

    "msnnews.msn.com" <> wrote in message
    news:OKFWajk%...
    > hi there,
    >
    > i have the following code on my ASPX page..:
    >
    > <LINK id="myCSS" runat="server" href="../print.css" type="text/css"
    > rel="stylesheet" />
    >
    > how do i reference this in the behind VB code so i can make the HREF
    > dynamic?
    >
    > thanks,
    > Paul
    >
    >
    David Jessee, Jan 16, 2005
    #4
    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. Shawn

    need quick answer to easy question

    Shawn, Mar 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    341
    Shawn
    Mar 6, 2004
  2. Hazzard
    Replies:
    2
    Views:
    623
    Hazzard
    Apr 6, 2004
  3. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    ASP.NET easy newby question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Nov 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    458
    Kevin Spencer
    Nov 23, 2004
  4. Robbe Morris [C# MVP]

    real easy help - no server cannot create ASP.NET

    Robbe Morris [C# MVP], Jan 2, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    376
    Robert
    Jan 3, 2006
  5. Bruno Desthuilliers
    Replies:
    5
    Views:
    370
    Bruno Desthuilliers
    Aug 29, 2007
Loading...

Share This Page