| | |
Modifying head tag of parent file.
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
Right now, I have a project with a class of a custom control. I also have a project with an .aspx file and its back code that implements the control of my other class.
In the control's class, I need to write code that will add some javascript in the head tag of web pages that will use this control.
I found out that with this code:
I can do it but I need the users to add runat="server" to the head tag of their pages for it to work.
Does anyone know how I would do this without modifying the aspx file's head tag?
Thank you very much...
In the control's class, I need to write code that will add some javascript in the head tag of web pages that will use this control.
I found out that with this code:
C# Syntax (Toggle Plain Text)
System.Web.UI.HtmlControls.HtmlGenericControl a = (System.Web.UI.HtmlControls.HtmlGenericControl)this.Parent.Parent.Controls[1]; a.InnerHtml += "<script type=\"text/javascript\" src=\"" + "file.js\"></script>";
I can do it but I need the users to add runat="server" to the head tag of their pages for it to work.
Does anyone know how I would do this without modifying the aspx file's head tag?
Thank you very much...
![]() |
Similar Threads
- Flash Shopping Cart (Website Reviews)
- ASP Code Works on Local 127.0.0.1 but Not on ISP's Server (ASP)
- how to use a javascript menu in asp.net (ASP.NET)
- How to set up include file for navbar (HTML and CSS)
- Pictures (Java)
- Amazing Website Designs - How do they do this? (Site Layout and Usability)
- Layout in CSS (HTML and CSS)
Other Threads in the C# Forum
- Previous Thread: how to insert a combo box in c# data grid
- Next Thread: Problem with sql reader
| Thread Tools | Search this Thread |
.net 2007 access algorithm appportability array bitmap box c# camera check checkbox client combobox control conversion cryptographyc#winformsencryption cs4 csharp customactions database datagrid datagridview dataset datastructure date datetime degrees disabled displayingopenforms draganddrop drawing encryption enum eventcloseformc# excel file form format forms ftp function gdi+ gis image index index-error input install java list listview load math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion pixels post prime programming radians regex remoting richtextbox rotation search security server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation view visual visualstudio webbrowser winforms wordautomation wpf xml






