This is a migrated thread and some comments may be shown as answers.

radMenu not working after script call code behind

1 Answer 36 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 16 Jul 2013, 03:47 PM
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";
                           }
                       }
                   }
               }

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 19 Jul 2013, 08:48 AM
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.
Tags
Menu
Asked by
Kevin
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or