Decrease Font Size
Increase Font Size
   BLOG

AjaxControlToolkit is undefined

by bryian 24. February 2010 15:28

'AjaxControlToolkit' is undefined |

'AjaxControlToolkit' is undefined (javascript) |

Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined |

MultiHandleSliderExtender

 

Problem

I have an AJAX MultiHandleSliderExtender Control and ToolkitScriptManager on the web page and everything work fine. Then I decided to include a Master Page to it, at runtime, I received the following errors

Message: Invalid character
Line: 1
Char: 3
Code: 0
URI: http://download.ysatech.com/MultiHandleSliderExtender_w_Chart/default2.aspx?_...
Message: 'AjaxControlToolkit' is undefined
Line: 182
Char: 5
Code: 0

This is a very weird error, the page work fine without the present of a Master Page. I started to look around and found the solution here. The solution is to set the "CombineScripts" property of the ToolkitScriptManager to false.

<ajaxToolkit:ToolkitScriptManager runat="server" ID="ajaxScriptManager" EnablePartialRendering="true" CombineScripts="false" />



Microsoft JScript runtime error: null is null or not an object

by bryian 24. February 2010 14:49

Microsoft JScript runtime error 'null' is null or not an object |

multiHandleSliderTarget.Handle |

MultiHandleSliderExtender | Microsoft JScript runtime error: null is null or not an object

 

Problem

I have an AJAX MultiHandleSliderExtender Control on the web page and everything work fine. Then I decided to include a Master Page to it, at runtime, I received the client-side error "Microsoft JScript runtime error 'null' is null or not an object".
This is a very weird error, the page work fine without the present of a Master Page. I started to look around and found out that the value of the ID and BehaviorID have to be identical. If you happen to come across the same error, give this solution a try. It work for me.

<cc1:MultiHandleSliderExtender ID="MultiHandleSliderExtender1" runat="server" ShowHandleDragStyle="true"
       BehaviorID="MultiHandleSliderExtender1" TargetControlID="txtSlider" Length="500" ShowInnerRail="true"
            EnableMouseWheel="false" OnClientDrag="Drag" Increment="1" OnClientDragStart="DragStart"
            RaiseChangeOnlyOnMouseUp="true" EnableRailClick="false"
            OnClientDragEnd="DragEnd"
            ShowHandleHoverStyle="true" Maximum="222" Minimum="1">
            <MultiHandleSliderTargets>
             <cc1:MultiHandleSliderTarget ControlID="rangeStart" />
                <cc1:MultiHandleSliderTarget ControlID="rangeEnd" />
            </MultiHandleSliderTargets>  
       </cc1:MultiHandleSliderExtender>

ASP-NET Confirm dialog box based on DropDownList selected value

by bryian 15. February 2010 13:30

ASP.NET Confirm dialog box based DropDownList selected value

ASP.NET JavaScript popup window basedon DropDownList selected value

Popup confirmation before ASP.NET Form Submit |

Add a JavaScript popup to an ASP.NET button |

Display Confirmation pop up window |

ASP.NET DropDownList Confirmation |

ASP.NET Adding JavaScript confirm to button based on DropDownList selected value |

Show JavaScript confirm message if DropDownList selected value equal

 

Requirement

User want to see a popup confirmation dialog box on LinkButton click, only if the DropDownList.SelectedValue == ?


See example below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:DropDownList runat="server" ID="ddlTest">
        <asp:ListItem Selected="True">select</asp:ListItem>
        <asp:ListItem>a</asp:ListItem>
        <asp:ListItem>b</asp:ListItem>
        <asp:ListItem>c</asp:ListItem>
        <asp:ListItem>d</asp:ListItem>
        <asp:ListItem>e</asp:ListItem>   
    </asp:DropDownList>
    
    <asp:LinkButton ID="IsertButton"
                  runat="server"
                  Text="Insert" onclick="IsertButton_Click"
                  OnClientClick="return CheckIfZeroSelected();" />
   
    </div>
    </form>
    
  <script type="text/javascript">
      function Insert_Confirmation() {
          if (confirm("Are you certain that you want to insert with selected value 0?"))
              return true; else return false;
      }

      function CheckIfZeroSelected() {
          var selObj = document.getElementById('<%= ddlTest.ClientID %>');

          if (selObj.selectedIndex === 0) {
              return Insert_Confirmation();
          }    
      }
  </script>  
</body>
</html>

MultiHandleSliderExtender could not be set on property MultiHandleSliderTargets

by bryian 7. February 2010 16:50

MultiHandleSliderExtender could not be set on property MultiHandleSliderTargets |

Error Creating Control - MultiHandleSliderExtender1

 

I was working with the AJAX MultiHandleSliderExtender control, the thing that bother me the most is the error listed below at design time. The code didn't throw any error at runtime.

Error Creating Control - MultiHandleSliderExtender1
'cc1:MultiHandleSliderExtender could not be set on property MultiHandleSliderTargets'

Here is the markup code

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<cc1:MultiHandleSliderExtender ID="MultiHandleSliderExtender2" runat="server">
       <MultiHandleSliderTargets>
       <cc1:MultiHandleSliderTarget ControlID="someID" />
       </MultiHandleSliderTargets>
       </cc1:MultiHandleSliderExtender>

After looking into the source code carefully, I noticed that the MultiHandleSliderTargets control is missing a TagPrefix next to it. Placing the TagPrefix "cc1:MultiHandleSliderTargets" has solved the problem.