开发者

ajaxtoolkit maskededitextender not working

i am using visual studio 2008 and using this tutorial:

http://www.asp.net/ajax/videos/how-do-i-use-the-aspnet-ajax-maskededit-controls

when i run the web application, there are no errors but the masking does not work and it seems that is not styling anything either.

here is my code:

   <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
         <br /><br />
        Enter a Date in the format 99/99/9999 (culture sensitive) <br />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1"
                runat="server"
                TargetControlID="TextBox1"
                Mask="99/99/9999"
                MaskType=Date
                MessageValidatorTip=true
                OnFocusCssClass="MaskedEditFocus"
                OnInvalidCssClass="MaskedEditError" />
            <ajaxToo开发者_C百科lkit:MaskedEditValidator ID="MaskedEditValidator1"
                runat="server"
                ControlToValidate="TextBox1"
                ControlExtender="MaskedEditExtender1"
                Display=Dynamic
                TooltipMessage="PLease enter a date"
                IsValidEmpty=false
                EmptyValueMessage="A Date is Required"
                InvalidValueMessage="Ths date is invalid" />  
                <br /><br />
        Enter a Number in the format $99,999.00 <br />
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2"
                runat="server"
                TargetControlID="TextBox2"
                Mask="99,999.99"
                MaskType=Number
                MessageValidatorTip=true
                OnFocusCssClass="MaskedEditFocus"
                OnInvalidCssClass="MaskedEditError"
                InputDirection=RightToLeft
                DisplayMoney=Left
                AcceptNegative=Left />
            <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2"
                runat="server"
                ControlToValidate="TextBox2"
                ControlExtender="MaskedEditExtender2"
                Display=Dynamic
                TooltipMessage="Please enter a value between -100 and 12000"
                IsValidEmpty=false
                EmptyValueMessage="A Number is Required"
                InvalidValueMessage="This Number is invalid"
                MinimumValue="-100"
                MinimumValueMessage="The value is too small." MaximumValue="12000"
                MaximumValueMessage="The number is too large" />  
                <br /><br />    
        Enter a Time in the Format 99:99:99 (type A or P for AM and PM)<br />
            <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
            <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender3"
                runat="server"
                TargetControlID="TextBox3"
                Mask="99:99:99"
                MaskType=Time
                MessageValidatorTip=true
                OnFocusCssClass="MaskedEditFocus"
                OnInvalidCssClass="MaskedEditError"
                AcceptAMPM=true />
            <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator3"
                runat="server"
                ControlToValidate="TextBox3"
                ControlExtender="MaskedEditExtender3"
                Display=Dynamic
                TooltipMessage="Please Enter a Time"
                IsValidEmpty=false
                EmptyValueMessage="A Time is Required"
                InvalidValueMessage="This Time is invalid" />
                <br /><br />     
        </div>
    </form>   
</body>
</html>

the DLL and PDB are both in the bin folder and i do have the toolbox

wat am i doing wrong?


I do not know if your example code is original or not, but I have seen comment sections like this...

<!--
    some comment with code fragments
-->

...cause the MaskedEditExtender to fail after the comment. You may have already removed comments from your example before posting it here.

Remove comments in the scripted area and see if it works after that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜