I am having issues with using the jQuery masked input plugin within a content page. It works fine in a normal web form but does not recognise the plugin within a content page.
this is the plugin: http://digitalbush.com/projects/masked-input-plugin/
here is a basic sample content page :
<%@ Page Title="" Language="C#" MasterPageFile="~/site.Master" AutoEventWireup="true" CodeBehind="masterContent.aspx.cs" Inherits="Dating.TEST.masterContent" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script src="../js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../js/jquery.maskedinput-1.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
//$('#<%= TextBox3.ClientID %>').mask("(999) 9999-9999");
$("#TextBox3").mask("(999) 9999-9999");
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:TextBox ID="TextBox3" runat="server" ClientIDMode="Static"></asp:TextBox>
</asp:Content>
when i debug this i get this error : “Uncaught TypeError: Object [object Object] has no method ‘mask'”
I have tried everything i can think of but it only seems to work in webforms.
The error you are seeing is happening because the jquery.maskedinput-1.3.js and / or jquery-1.8.2.min.js are not being loaded successfully.
Check the location of these files is correct relative to the page you are loading.