Hi, guys!
Does anyone knows the resolution of a problem when i need to insert <link> or <script> tag into HEAD section dynamically?
I was trying few ways to do this: 1) RegisterClientScriptBlock inserts script right after form.
2) RegisterStartupScript inserts script before post form.
3) Page.Controls.Add(new LiteralControl("<LINK rel='stylesheet' href='include/inputbox.css' type='text/css'>")); (or AddAt method) Works, but inserts only the last one tag to the end of a page.
P.S. I need to INSERT new LINK or SCRIPT tag but to change the href or src attribute of an existing tag.
--
Sergey Morkovkin, Web Project Leader
Celline Ltd. - World of content in real time http://www.celline.com.ua
+380 44 234 65 36
+380 67 280 11 22
Add a "runat=server" attribute to your <head> tag, give it an id, and wire
it up to an HtmlGenericControl object in your CodeBehind. Then you can
manipulate it like any other Control, as well as adding to its' Controls
Collection.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer http://www.takempis.com
Big Things are made up of
Lots of Little Things.
Sergey Morkovkin said:
Hi, guys!
Does anyone knows the resolution of a problem when i need to insert <link>
I was trying few ways to do this: 1) RegisterClientScriptBlock inserts script right after form.
2) RegisterStartupScript inserts script before post form.
3) Page.Controls.Add(new LiteralControl("<LINK rel='stylesheet'
I was trying few ways to do this: 1) RegisterClientScriptBlock inserts script right after form.
2) RegisterStartupScript inserts script before post form.
3) Page.Controls.Add(new LiteralControl("<LINK rel='stylesheet'
I was trying few ways to do this: 1) RegisterClientScriptBlock inserts script right after form.
2) RegisterStartupScript inserts script before post form.
3) Page.Controls.Add(new LiteralControl("<LINK rel='stylesheet'
I was trying few ways to do this: 1) RegisterClientScriptBlock inserts script right after form.
2) RegisterStartupScript inserts script before post form.
3) Page.Controls.Add(new LiteralControl("<LINK rel='stylesheet'