|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
javascript and navigateurlI have an userControl .ascx with a gridView control. One of the columns is a TemplateField with an HyperLink control. On the Row_DataBound event, I am checking that one of the other columns contains a value, then I would open a pop-up window. I am showing the HyperLink control only sometimes and I set the NavigateUrl only in these cases. In order to implement the pop-up window I try to put the javascript function into the file .ascx and then I call it with NavigateUrl="javascript:myfunction();". So, it's all ok. Now. I would have to use the javascript function in other usercontrol ..ascx. I tried to create an external file .js and I put into the section <HEAD> of my usercontrol the statement <script.... src='myfilejs.js'/> but it doesn't work. I tried with several methods of ClientScriptManager (I'm working with asp.net 2.0)... I used RegisterClientScriptInclude and RegisterClientScriptBlock but the result is the same... nothing! Why? How do I implement ClientScriptManager? It's not possible to use in some way an external .js file? Thanks a lot. davide ps: sorry for my bad english!! Hi, make sure that your path of external js is correct. Use something
like <script.... src='~/myfilejs.js'/> or equivalent syntax. Hope this helps.. Regards, Alvin Chooi Microsoft ASP.NET Enthusiast http://alvinzc.blogspot.com
Need button control that...
3 step wizard - ignore last step Can't duplicate ID in subclassed GridView menu question WebParts & Highend Portals Gridview sorting event - Gridview Datasource always Null .. why??? way to make 2 GridViews line up all bitmap button in grid? how to validate input of a detailsview? Anyone have APP_LocalResources resx files for the MS controls... |
|||||||||||||||||||||||