The error occurs by the line:2760 of MaskedEditBehaviro.js when MaskedEditExtender is used by the following codes. (When the Button1 is clicked.)
MaskedEditExtender
- MaskType: Date
- Mask: 99/99/99 ("yy/MM/dd" format)
aspx code.
-------------------------------------------------
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TextBox1"
Mask="99/99/99" MaskType="Date">
</cc1:MaskedEditExtender>
<cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
ControlToValidate="TextBox1" InvalidValueMessage="Error!">
</cc1:MaskedEditValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
-------------------------------------------------
MaskedEditBehaviro.js
-------------------------------------------------
2729: , AutoFormatDate : function()
2730: {
...
2734: var Y4 = (this._maskvalid.indexOf("9999") != -1)?true:false;
...
2740: var Dcur,Mcur,Ycur;
2741: if (autocomp == "")
2742: {
2743: var CurDate = new Date();
...
2754: if (Y4)
2755: {
2756: Ycur = CurDate.getUTCFullYear().toString();
2757: }
2758: else
2759: {
2760: Ycur = Ycur.substring(2); // Error! : Ycur is undefined.
2761: }
2762: }
-------------------------------------------------
So I propose the following changes.
MaskedEditBehaviro.js
-------------------------------------------------
Ycur = CurDate.getUTCFullYear().toString();
if (Y4 == false)
{
Ycur = Ycur.substring(2);
}
-------------------------------------------------
Comments: Issues is closed as it is fixed with April 2013 release.
MaskedEditExtender
- MaskType: Date
- Mask: 99/99/99 ("yy/MM/dd" format)
aspx code.
-------------------------------------------------
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TextBox1"
Mask="99/99/99" MaskType="Date">
</cc1:MaskedEditExtender>
<cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
ControlToValidate="TextBox1" InvalidValueMessage="Error!">
</cc1:MaskedEditValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
-------------------------------------------------
MaskedEditBehaviro.js
-------------------------------------------------
2729: , AutoFormatDate : function()
2730: {
...
2734: var Y4 = (this._maskvalid.indexOf("9999") != -1)?true:false;
...
2740: var Dcur,Mcur,Ycur;
2741: if (autocomp == "")
2742: {
2743: var CurDate = new Date();
...
2754: if (Y4)
2755: {
2756: Ycur = CurDate.getUTCFullYear().toString();
2757: }
2758: else
2759: {
2760: Ycur = Ycur.substring(2); // Error! : Ycur is undefined.
2761: }
2762: }
-------------------------------------------------
So I propose the following changes.
MaskedEditBehaviro.js
-------------------------------------------------
Ycur = CurDate.getUTCFullYear().toString();
if (Y4 == false)
{
Ycur = Ycur.substring(2);
}
-------------------------------------------------
Comments: Issues is closed as it is fixed with April 2013 release.