javascript code dont fire in nested user controls

2 posts, 0 answers
  1. Mehdi
    Mehdi avatar
    4 posts
    Member since:
    Jan 2013

    Posted 10 Feb 2013 Link to this post

    i define a user controls inside other user control and define a 
    RadScriptBlock,place script code in it,but script block dont fire.please
     help me.
    my code is:

    ID="RadScriptBlock1" runat="server"> <script type="text/javascript" language="javascript"> function refreshGrid(arg) { alert("1234"); $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); } function RowDblClick(sender, eventArgs) { window.radopen("Details.aspx?codemessage=" + eventArgs.getDataKeyValue("codeadvertisment"), "UserListDialog"); } function OpenFileExplorerDialog() { var wnd = $find("<%= ExplorerWindow.ClientID %>");; } //This function is called from the Explorer.aspx page function OnFileSelected(wnd, fileSelected) { var textbox = $get("<%= UploadPicture.ClientID %>"); textbox.value = fileSelected; } function ShowMessage(sender, args) { var id = args.getDataKeyValue("codeadvertisment"); var wnd = window.radopen("Details.aspx?codemessage=" + id, null); //Get the clicked row var index = args.get_itemIndexHierarchical(); var item = args.get_tableView().get_dataItems()[index]; var rowElement = item.get_element(); //Get coordinates of the row and reposition the window relative to it var bounds = $telerik.getBounds(rowElement); wnd.moveTo(bounds.x + 120 + index * 10, bounds.y - 180); } </script> </telerik:RadScriptBlock>
  2. MasterChiefMasterChef
    MasterChiefMasterChef avatar
    152 posts
    Member since:
    Jan 2013

    Posted 13 Feb 2013 Link to this post

    Hi Mehdi,

    Is there any way you can provide the context that the RadScriptBlock is in? There probably isn't anything wrong with your functions, rather, the DOM is probably not able to find the script tag if it is nested so deep into your code. Is there any way you can just relocate these functions into a script that isn't inside of two user controls?

    Good luck,
    Master Chief
  3. DevCraft R3 2016 release webinar banner
Back to Top