![]() |
Write into <HEAD></HEAD> section?
Is it possible to write into HEAD section, for example to write out a LINK
tag? |
Re: Write into <HEAD></HEAD> section?
hi Jiho,
try <head id="head1" runat="server"></head> delcare head1 as an HtmlControls.HtmlGenericControl and then access it from code. "Jiho Han" <jiho.han@infinityinfo.com> wrote in message news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > Is it possible to write into HEAD section, for example to write out a LINK > tag? > > |
Re: Write into <HEAD></HEAD> section?
Hi Jiho,
Add a runat="server" attribute to the <head> tag, then refer it in your codebehind by its ID and you're ready to go... (the IDE will wipe off your <head> tag from time to time...) -- Victor Garcia Aprea Microsoft MVP | ASP.NET Looking for insights on ASP.NET? Read my blog: http://obies.com/vga/blog.aspx To contact me remove 'NOSPAM'. Please post all questions to the newsgroup "Jiho Han" <jiho.han@infinityinfo.com> wrote in message news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > Is it possible to write into HEAD section, for example to write out a LINK > tag? > > |
Re: Write into <HEAD></HEAD> section?
Thanks guys for your help.
"Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message news:%23ANgCOu2DHA.540@tk2msftngp13.phx.gbl... > Hi Jiho, > > Add a runat="server" attribute to the <head> tag, then refer it in your > codebehind by its ID and you're ready to go... (the IDE will wipe off your > <head> tag from time to time...) > > -- > Victor Garcia Aprea > Microsoft MVP | ASP.NET > Looking for insights on ASP.NET? Read my blog: > http://obies.com/vga/blog.aspx > > To contact me remove 'NOSPAM'. Please post all questions to the newsgroup > "Jiho Han" <jiho.han@infinityinfo.com> wrote in message > news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > > Is it possible to write into HEAD section, for example to write out a LINK > > tag? > > > > > > |
Re: Write into <HEAD></HEAD> section?
Jiho was looking to write a <link> tag. I've attempted this myself. I can
successfully write the <link> tag, but it does not work to access the .css file and render the styles at design time. Run-time is perfectly fine. Any clue how to get a programmatically added <link> tag to successfully render the css styles? Thanks! Sam Fields "Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message news:%23ANgCOu2DHA.540@tk2msftngp13.phx.gbl... > Hi Jiho, > > Add a runat="server" attribute to the <head> tag, then refer it in your > codebehind by its ID and you're ready to go... (the IDE will wipe off your > <head> tag from time to time...) > > -- > Victor Garcia Aprea > Microsoft MVP | ASP.NET > Looking for insights on ASP.NET? Read my blog: > http://obies.com/vga/blog.aspx > > To contact me remove 'NOSPAM'. Please post all questions to the newsgroup > "Jiho Han" <jiho.han@infinityinfo.com> wrote in message > news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > > Is it possible to write into HEAD section, for example to write out a LINK > > tag? > > > > > > |
Re: Write into <HEAD></HEAD> section?
Sam,
I don't know what you mean by your question. Are you trying to have the css "rendered" at design-time? I don't know if that's possible. For example, I tried to set the bgcolor of the BODY tag but it had no effect on the designer window. I would guess that's probably the same behavior you can expect with the css at design-time. In any case, I decided not to use the LINK in my control. After all, as a control developer, I can't control whether the page developer specifies runat="server" attribute on the HEAD tag. Instead I have decided to add the necessary tags via client script block. RegisterClientScriptBlock method works fine for me in this case. Thanks all for your help! Jiho "Sam Fields" <sfields@state.pa.us> wrote in message news:e98aOI62DHA.3216@TK2MSFTNGP11.phx.gbl... > Jiho was looking to write a <link> tag. I've attempted this myself. I can > successfully write the <link> tag, but it does not work to access the .css > file and render the styles at design time. Run-time is perfectly fine. > > Any clue how to get a programmatically added <link> tag to successfully > render the css styles? > > Thanks! > Sam Fields > > "Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message > news:%23ANgCOu2DHA.540@tk2msftngp13.phx.gbl... > > Hi Jiho, > > > > Add a runat="server" attribute to the <head> tag, then refer it in your > > codebehind by its ID and you're ready to go... (the IDE will wipe off your > > <head> tag from time to time...) > > > > -- > > Victor Garcia Aprea > > Microsoft MVP | ASP.NET > > Looking for insights on ASP.NET? Read my blog: > > http://obies.com/vga/blog.aspx > > > > To contact me remove 'NOSPAM'. Please post all questions to the newsgroup > > "Jiho Han" <jiho.han@infinityinfo.com> wrote in message > > news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > > > Is it possible to write into HEAD section, for example to write out a > LINK > > > tag? > > > > > > > > > > > > |
Re: Write into <HEAD></HEAD> section?
It acutally applies all the styles at design-time, but only if the <link>
tag is added to the top of the aspx page, and not added programmatically. For this same reason, I abandoned adding <link> tags in my controls as well. Anyway, thanks for your response! Sam "Jiho Han" <jiho.han@infinityinfo.com> wrote in message news:ebtQrzE3DHA.2544@TK2MSFTNGP10.phx.gbl... > Sam, > > I don't know what you mean by your question. Are you trying to have the css > "rendered" at design-time? I don't know if that's possible. For example, I > tried to set the bgcolor of the BODY tag but it had no effect on the > designer window. I would guess that's probably the same behavior you can > expect with the css at design-time. > > In any case, I decided not to use the LINK in my control. After all, as a > control developer, I can't control whether the page developer specifies > runat="server" attribute on the HEAD tag. Instead I have decided to add the > necessary tags via client script block. RegisterClientScriptBlock method > works fine for me in this case. > > Thanks all for your help! > Jiho > > "Sam Fields" <sfields@state.pa.us> wrote in message > news:e98aOI62DHA.3216@TK2MSFTNGP11.phx.gbl... > > Jiho was looking to write a <link> tag. I've attempted this myself. I > can > > successfully write the <link> tag, but it does not work to access the ..css > > file and render the styles at design time. Run-time is perfectly fine. > > > > Any clue how to get a programmatically added <link> tag to successfully > > render the css styles? > > > > Thanks! > > Sam Fields > > > > "Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message > > news:%23ANgCOu2DHA.540@tk2msftngp13.phx.gbl... > > > Hi Jiho, > > > > > > Add a runat="server" attribute to the <head> tag, then refer it in your > > > codebehind by its ID and you're ready to go... (the IDE will wipe off > your > > > <head> tag from time to time...) > > > > > > -- > > > Victor Garcia Aprea > > > Microsoft MVP | ASP.NET > > > Looking for insights on ASP.NET? Read my blog: > > > http://obies.com/vga/blog.aspx > > > > > > To contact me remove 'NOSPAM'. Please post all questions to the > newsgroup > > > "Jiho Han" <jiho.han@infinityinfo.com> wrote in message > > > news:O5VJ3Ht2DHA.556@TK2MSFTNGP11.phx.gbl... > > > > Is it possible to write into HEAD section, for example to write out a > > LINK > > > > tag? > > > > > > > > > > > > > > > > > > > > |
| All times are GMT. The time now is 01:27 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.