I am having issues getting access to the UltraWebgrid on the client side in the pageLoad event.
Every time I find the control it returns null. Looking further into the issue I found that if I add a timer and wait a second it will find the control fine. I assume the scripts are not loaded when the pageLoad event is fired (Works in 2009.2 fine).
I checked this out more using a WebImageButton and proved this by watching the debugger. I attempt to find my control on page load, it fails then the initButton script in added to my page.
This is causing various problems in my application now when it worked fine before. Adding a timer to wait a second can work for now but is not the best solution.
Is there a way to force the scripts to load before pageLoad so my code inside the function can work as expected?
Hello RichBamford,
You may use RegisterStartupScript on PageLoad event or on any event , to trigger the script you wish to perform.
RegisterStartupScript enables server side codes run client side scripts.
For more details please refer to the following documents :
http://msdn.microsoft.com/en-us/library/asz8zsxy.aspx
http://msdn.microsoft.com/en-us/library/bb359558.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.registerstartupscript.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=200
Please let me know if you have any questions.
Please let me know how it went with the suggested approach concerning the UltraWebGrid.
If you have further questions, please let me know as well.