Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Write into <HEAD></HEAD> section?

Reply
Thread Tools

Write into <HEAD></HEAD> section?

 
 
Jiho Han
Guest
Posts: n/a
 
      01-14-2004
Is it possible to write into HEAD section, for example to write out a LINK
tag?


 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      01-14-2004
hi Jiho,
try <head id="head1" runat="server"></head>

delcare head1 as an HtmlControls.HtmlGenericControl
and then access it from code.


"Jiho Han" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to write into HEAD section, for example to write out a LINK
> tag?
>
>



 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      01-14-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to write into HEAD section, for example to write out a LINK
> tag?
>
>



 
Reply With Quote
 
Jiho Han
Guest
Posts: n/a
 
      01-14-2004
Thanks guys for your help.

"Victor Garcia Aprea [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is it possible to write into HEAD section, for example to write out a

LINK
> > tag?
> >
> >

>
>



 
Reply With Quote
 
Sam Fields
Guest
Posts: n/a
 
      01-15-2004
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]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is it possible to write into HEAD section, for example to write out a

LINK
> > tag?
> >
> >

>
>



 
Reply With Quote
 
Jiho Han
Guest
Posts: n/a
 
      01-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Is it possible to write into HEAD section, for example to write out a

> LINK
> > > tag?
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Sam Fields
Guest
Posts: n/a
 
      01-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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]" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > 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" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Is it possible to write into HEAD section, for example to write out

a
> > LINK
> > > > tag?
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
How to use Response.write to write to a specific area on a aspx pa =?Utf-8?B?QWJlbCBDaGFu?= ASP .Net 6 05-03-2006 10:16 PM
Re: It seems that ZipFile().write() can only write files,how can empty directories be put into it? could ildg Python 0 07-02-2005 08:31 AM
Re: It seems that ZipFile().write() can only write files,how can empty directories be put into it? Jeff Epler Python 0 07-01-2005 02:06 PM
It seems that ZipFile().write() can only write files,how can empty directories be put into it? could ildg Python 0 07-01-2005 01:50 AM
how to write some xml into huge xml file into speceific location??? Xenia XML 4 11-25-2003 07:14 PM



Advertisments