The pages of my project are based on the main and content pages ...
I want to do something with javascript (not jquery) on one of the content pages after ALL MASTER ELEMENTS AND CONTENTS ARE LOADED FULLY . (e.g. focus on the RadComboBox control)
For this, I used the code below:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> <script type="text/javascript"> onload = onloadOfDocument; function onloadOfDocument() { var combo = $find("<%= RadcbPersonelCompleteNameInvwNoskhehEdit.ClientID %>"); alert(combo); var comboInput = combo.get_inputDomElement(); comboInput.focus(); } </script> </asp:Content>
But alert(combo); always returns null. (the $find code is for telerik controls, and the top telerik control codes are completely correct)
To solve this null problem, I am testing the methods shown below:
1- I removed all controls from the main page and content except RadComboBox Control, and the problem with zero disappeared, so I got a peoblem zero, about all elements of the wizard page and content were not loaded when
$find("<%= RadcbPersonelCompleteNameInvwNoskhehEdit.ClientID %>");
.
2- therefore I used
$(document).ready(function() { my codes });
instead
onload = onloadOfDocument;
but the problem is not solved - I do not know why !!!
3- finally, I am testing the code below and it works fine:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> <script type="text/javascript"> </script>
What document function should I use to execute some javascript codes after all the MASTER AND CONTENT elements are fully loaded ?
Thanks in advance in advance