- Add javascript file to your project
- Set Build Action of this file Embeded Resource
- Add the following entry into your AssemblyInfo.cs
[assembly: WebResource("YourNameSpace.Filename.js", "text/javascript")] - Add following code in your OnInit event
string webresourceURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), "YourNameSpace.Filename.js");
this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "cctextbox",webresourceURL); - Please remember YourNameSpace is base name space in your project
Showing posts with label Embeded resource. Show all posts
Showing posts with label Embeded resource. Show all posts
Monday, September 29, 2008
Embedding Javascript file in custom control
Subscribe to:
Posts (Atom)