radMenu not working after script call code behind

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    265 posts
    Member since:
    Jun 2011

    Posted 16 Jul 2013 Link to this post

    I have an instance where i need to call some javscript from my code behind file, and when I do, no other fucntions work on the page anymore.  My radmenu no longer works and all the ajaxtool kit stuff i have operating no longer work as well.  I put everything in a radScriptBlock but the same result.  how can I resolve this problem.  This command does nothing with the menu system, it just opens up a div if a value equals 1.  I need to call in code behind only in certain instance but it disables everything else and should not.


    If myDataTable.Rows.Count > 0 Then
               If myDataTable.Rows(0)(2) = "True" Then
                   FILLDDL() 'Fill the drop down lists
                   rblReported.SelectedValue = 1
                   ScriptManager.RegisterStartupScript(Me.Page, GetType(String), "OpenDiv", "OpenDiv();", True)
               Else
                   rblReported.SelectedValue = 0
               End If
     
           Else
     
           End If
     
     
     
    function OpenDiv() {
                       var rbl = document.getElementById("<%=rblReported.ClientID%>");
                       var radios = rbl.getElementsByTagName("input");
                       var div = document.getElementById("Recruited");
                       var forms = document.getElementById("printform");
                       var Recheader = document.getElementById("RecInfo");
                       var Selval
                       for (var i = 0; i < radios.length; i++) {
                           if (radios[i].checked) {
                               Selval = radios[i].value;
                               if (Selval == 1) {
                                   div.style.display = "inline";
                                   forms.style.display = "inline";
                                   Recheader.style.display = "inline";
                               }
                               else if (Selval == 0) {
                                   div.style.display = "none";
                                   forms.style.display = "none";
                                   Recheader.style.display = "none";
                               }
                           }
                       }
                   }

  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 19 Jul 2013 Link to this post

    Hello Kevin,

    The most common reason for such behavior is a javascript error. Could you verify whether there are any javascript errors on the page once this script is registered?

    Regards,
    Dimitar Terziev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top