for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
ThanksThis sets technique sets the Title programmatically but you might be able to
rejig it to do a <link
http://authors.aspalliance.com/kenc/faq5.aspx
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
>I need to dynamically set the href attribute for the <link> tag at run time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
> setting.
> Any ideas?
> Thanks
Hi,
Give the <link> tag id="lnk" (can be anything) and runat=server attributes.
From code-behind, use the Attributes property, like normal server-side
controls, to add attribute values:
lnk.Attributes.Add ("rel", "stylesheet")
lnk.Attributes.Add ("href", "primary.css")
HTH.
"Robert Strickland" <bstrickland@.comporium.net> wrote in message
news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
I need to dynamically set the href attribute for the <link> tag at run time
for my pages. I thought I saw code using the asp:placeholder to give the
code-behind a place to update the html control with a specific href setting.
Any ideas?
Thanks
Thanks
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:#TdPDLliEHA.636@.TK2MSFTNGP12.phx.gbl...
> This sets technique sets the Title programmatically but you might be able
to
> rejig it to do a <link>
> http://authors.aspalliance.com/kenc/faq5.aspx
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
> >I need to dynamically set the href attribute for the <link> tag at run
time
> > for my pages. I thought I saw code using the asp:placeholder to give the
> > code-behind a place to update the html control with a specific href
> > setting.
> > Any ideas?
> > Thanks
thanks
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:#SjXjlliEHA.356@.tk2msftngp13.phx.gbl...
> Hi,
> Give the <link> tag id="lnk" (can be anything) and runat=server
attributes.
> From code-behind, use the Attributes property, like normal server-side
> controls, to add attribute values:
> lnk.Attributes.Add ("rel", "stylesheet")
> lnk.Attributes.Add ("href", "primary.css")
> HTH.
> "Robert Strickland" <bstrickland@.comporium.net> wrote in message
> news:eoYrcOkiEHA.356@.tk2msftngp13.phx.gbl...
> I need to dynamically set the href attribute for the <link> tag at run
time
> for my pages. I thought I saw code using the asp:placeholder to give the
> code-behind a place to update the html control with a specific href
setting.
> Any ideas?
> Thanks
0 comments:
Post a Comment