Handling JS file in Resources
-
I am having a global resource file in the App_GlobalResources folder. In that I have included my JS file. Also it is in the web applicaiton also. In the run time I want to load the js based on the resource file selected in the page and to register the events for the buttone. Kindly help me how to do it. Thanks a lot in advance.
Best Regards, M. J. Jaya Chitra
-
I am having a global resource file in the App_GlobalResources folder. In that I have included my JS file. Also it is in the web applicaiton also. In the run time I want to load the js based on the resource file selected in the page and to register the events for the buttone. Kindly help me how to do it. Thanks a lot in advance.
Best Regards, M. J. Jaya Chitra
When you add resource in the resource file in a web application it doesn’t get marked with the WebResource attribute, it means that you can not access this on the basis of the ui culture using a resource manager. This is more appropriate for control development. I suggest you to manually load the js file on the basis of the ui culture. Instead of embedding the js file in global resource, place them in a separate folder and load them accordingly.
Regards, Prakash Kalakoti
-
When you add resource in the resource file in a web application it doesn’t get marked with the WebResource attribute, it means that you can not access this on the basis of the ui culture using a resource manager. This is more appropriate for control development. I suggest you to manually load the js file on the basis of the ui culture. Instead of embedding the js file in global resource, place them in a separate folder and load them accordingly.
Regards, Prakash Kalakoti
Dear Prakash, Thank your for your hint. Can you tell me how to load the JS dynamically by having them in the web application.
Best Regards, M. J. Jaya Chitra
-
Dear Prakash, Thank your for your hint. Can you tell me how to load the JS dynamically by having them in the web application.
Best Regards, M. J. Jaya Chitra
Check the Thread.CurrentThread.CurrentCulture.Name and register the script using CleintScript.RegisterClientScriptInclude method like
ClientScript.RegisterClientScriptInclude("MyScript","MyScript.en-GB.js")
Regards, Prakash Kalakoti
-
Check the Thread.CurrentThread.CurrentCulture.Name and register the script using CleintScript.RegisterClientScriptInclude method like
ClientScript.RegisterClientScriptInclude("MyScript","MyScript.en-GB.js")
Regards, Prakash Kalakoti
Thank you so much it is working fine.
Best Regards, M. J. Jaya Chitra