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

Problems with MasterPage and Javascript

4 Answers 87 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Yamil
Top achievements
Rank 1
Yamil asked on 20 Jun 2008, 11:20 PM
I have an aspx that works ok but when i convert to use a master page I am getting a lot of trouble with my javascript code. For example
function AppointmentInserting(sender, eventArgs)  
{  
   var idSucursal = $get("ddlSucursal").value + ";" + $get("ddlSucursal").options[$get("ddlSucursal").selectedIndex].text;  
   var idEspecialidad = $get("ddlEspecialidad").value + ";" + $get("ddlEspecialidad").options[$get("ddlEspecialidad").selectedIndex].text;  
   var idMedico = "";  
   if ($get("ddlMedicos").value == "")  
   {  
       alert("Debe seleccionar el medico");  
   }  
   else  
   {  
      var idMedico = $get("ddlMedicos").value + ";" + $get("ddlMedicos").options[$get("ddlMedicos").selectedIndex].text;  
      var start = formatDate(eventArgs.get_startTime());  
      var parametros = "Modo=Insert&Inicio=" + start +   
           "&Sucursal=" +  idSucursal +   
                  "&Medico=" + idMedico +  
             "&Especialidad=" + idEspecialidad;  
      var url = "CitaMedicoEditor.aspx?" + parametros  
 
      window.radopen(url, "dlgEdicion");              
     eventArgs.set_cancel(true);  
 }      
}  
 

When i double click in my RadScheduler I got "Object required" error..

How do i solve this ?

4 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 23 Jun 2008, 11:42 AM
Hi Yamil,

Please answer our questions in Ticket ID: 119102.

All the best,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Yamil
Top achievements
Rank 1
answered on 01 Jul 2008, 04:06 PM
Any help for this problem ?

Best Regards
0
Atanas Korchev
Telerik team
answered on 02 Jul 2008, 06:59 AM
Hello Yamil,

You seem to be using hardcoded ClientIDs in your JavaScript which is not a best practice. When you use master pages those will change as described in this blog post.

For example instead of using
$get("ddlSucursal")

you should be using

$get("<%= ddlSucursal.ClientID%>");

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Yamil
Top achievements
Rank 1
answered on 03 Jul 2008, 08:40 PM
Thanks Albert .It works like charm...!

Best Regards

Tags
Ajax
Asked by
Yamil
Top achievements
Rank 1
Answers by
Paul
Telerik team
Yamil
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or