Custom control with client-side script
-
I am making a super duper custom web control with fancy client-side script. In keeping with the ASP.Net model I have decided to put my client-side script into a js file and store it with the ASP.Net ones in \aspnet_client\system_web\[version]\... I could write the HTML to include this file as part of the render process, but then I will have multiple references to the same file. Is there some way I can register with ASP.Net that I have a client-side script file to be linked like it does for it's own client-side script files? Gracias JBoy
-
I am making a super duper custom web control with fancy client-side script. In keeping with the ASP.Net model I have decided to put my client-side script into a js file and store it with the ASP.Net ones in \aspnet_client\system_web\[version]\... I could write the HTML to include this file as part of the render process, but then I will have multiple references to the same file. Is there some way I can register with ASP.Net that I have a client-side script file to be linked like it does for it's own client-side script files? Gracias JBoy
Hello, Don't understand much about your question. But I guess that you want to add a link to your .js file just only once. You can use the method Page.RegisterClientScriptBlock(key as string, htmltext as string) in the function OnPreRender().