|
|
 |
RE: FN-FORUM: Asp.Net / C# HELP! P
date posted 9th January 2008 16:08
> Any c# / .Net folk out there who can give me a hand.
>=20
> I have a number of page menus using =
=C3=A2=E2=82=AC=CB=9C.js=C3=A2=E2=82=AC=E2=84=A2 files. I need to
> programmatically add the appropriate file at a set location in the =
html,
> based on a given criteria.
>=20
> Can anyone offer some insight towards this? I recall using some c code
> that for this a long time ago., but can no longer find reference to =
this.
>=20
> Any help would be appreciated.
>=20
.Net 1.1 or 2.0
1.1 just use a asp:Literal and place the code there (even in the header)
If you are using 2.0 and want to dynamically add a ref to a js file in =
the header use
System.Web.UI.HtmlControls.HtmlGenericControl scpt =3D new =
HtmlGenericControl("script");
scpt.Attributes.Add("type", "text/javascript");
=20
Header.Controls.Add(scpt);
HTH
Damon
|
 |
|