MaskedEdit and Wizard validation issue

Last post 10-05-2007 4:20 AM by Jonathan Shen – MSFT. 5 replies.

Sort Posts:

  • MaskedEdit and Wizard validation issue

    09-29-2007, 6:04 AM
    • Member
      8 point Member
    • fbi1970
    • Member since 09-29-2007, 10:02 AM
    • Posts 7

    Placing a MaskedEdit and a MaskedEditValidator to validate a date (italian dates are formatted dd/MM/yyyy) into a wizard step, even if the date is correct the validation error is raised as soon as clicking on "next step" button.
    Removing the wizard control all works.

    Here's a code to reproduce the bug. Version is latest 10920.

    <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true">
    </cc1:ToolkitScriptManager>
    <asp:Wizard ID="Wizard1" runat="server">
    <WizardSteps>
    <asp:WizardStep runat="server" title="Step 1">
    <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
    ControlExtender="MaskedEditExtender1" ControlToValidate="txt_Data"
    Display="Dynamic" EmptyValueMessage="(!)&nbsp;"
    ErrorMessage="MaskedEditValidator1&#34; InvalidValueMessage="(!)&nbsp;"
    IsValidEmpty="False" SetFocusOnError="True">
    </cc1:MaskedEditValidator>
    <asp:TextBox ID="txt_Data" runat="server" Width="75px"></asp:TextBox>
    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server"
    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="&#34;
    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder=""
    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"
    Mask="99/99/9999" MaskType="Date" TargetControlID="txt_Data">
    </cc1:MaskedEditExtender>
    </asp:WizardStep>
    <asp:WizardStep runat="server" title="Step 2">
    </asp:WizardStep>
    </WizardSteps>
    </asp:Wizard>
    </form>

  • Re: MaskedEdit and Wizard validation issue

    09-29-2007, 2:55 PM
    • Star
      8,978 point Star
    • dwhite
    • Member since 02-08-2007, 2:25 PM
    • Bristol, CT
    • Posts 1,422

    My guess is that it has something to do with the CultureDateFormat being set to ""

    Try:

    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server"
    CultureCurrencySymbolPlaceholder="&#34;
    Enabled="True" Mask="99/99/9999" MaskType="Date" TargetControlID="txt_Data">
    </cc1:MaskedEditExtender>

    -Damien

    Visoft, Inc - Home | Blogs

    Latest Blog Post: Silverlight DataBinding Bug
  • Re: MaskedEdit and Wizard validation issue

    09-29-2007, 3:09 PM
    • Member
      8 point Member
    • fbi1970
    • Member since 09-29-2007, 10:02 AM
    • Posts 7

    Sorry, but the real code used is similar to the one you wrote. VS added some empty string properties before I copy it. The right code was:

     <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="true">
    </cc1:ToolkitScriptManager>
    <asp:Wizard ID="Wizard1" runat="server">
    <WizardSteps>
    <asp:WizardStep runat="server" Title="Step 1">
    <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
    ControlToValidate="txt_Data" Display="Dynamic" EmptyValueMessage="(!)&nbsp;"
    ErrorMessage="MaskedEditValidator1" InvalidValueMessage="(!)&nbsp;" IsValidEmpty="False"
    SetFocusOnError="True">
    </cc1:MaskedEditValidator>
    <asp:TextBox ID="txt_Data" runat="server" Width="75px"></asp:TextBox>
    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Enabled="True" Mask="99/99/9999"
    MaskType="Date" TargetControlID="txt_Data">
    </cc1:MaskedEditExtender>
    </asp:WizardStep>
    <asp:WizardStep runat="server" Title="Step 2">
    </asp:WizardStep>
    </WizardSteps>
    </asp:Wizard>
    </form>

    Even I tested also adding CultureName="it-IT" and removing it in MaskEditExtender. Same result.
    I suggest developers to test and search for a workaround or to fix the bug.

    -gio

    Added: Furthermore the same result is shown by using a "Time" validator and a MaskEdit such as "HH:mm"

     

  • Re: MaskedEdit and Wizard validation issue

    09-29-2007, 5:53 PM
    • Star
      8,978 point Star
    • dwhite
    • Member since 02-08-2007, 2:25 PM
    • Bristol, CT
    • Posts 1,422

    Here's a related post, also see if the sample works.  Perhaps try updating your version of the Toolkit to the latest as well...  Do you think the problem is a culture one; for example is it set to US (MM/dd/yyyy) or is it just not working at all?

    -Damien

    Visoft, Inc - Home | Blogs

    Latest Blog Post: Silverlight DataBinding Bug
  • Re: MaskedEdit and Wizard validation issue

    09-30-2007, 4:55 AM
    • Member
      8 point Member
    • fbi1970
    • Member since 09-29-2007, 10:02 AM
    • Posts 7

    I'm using lastest release (10920) while previous one (10618) was working right. I get this behaviour by simply upgrading the toolkit dll in the bin folder of the web.

    The matter is not culture name. I tested by using empty string, and "it-IT" culture name. "en-US" is not useful because I need italian date validation.

    Furthermore the validator works right while filling in date strings. It does not work only when you press the "next" button of the wizard control. It simply mark a valid italian formatted date as invalid pressing the next button, and not while filling in it. If you remove the wizard control and do a simple postback all works right.

    I think it's a bug introduced in 10920 release and that it's related to the validator placed inside another control. In fact there's a issue in 10920 release about validation wrong behaviour when validator is placed inside an Update Panel. I think it's the same bug or a related one.

    Thanks

    -gio

     

  • Re: MaskedEdit and Wizard validation issue

    10-05-2007, 4:20 AM
    Answer

    Hi Gio,

    Based on my experience, your problem is not caused by the different version of Ajax Control Toolkit.  Please add <globalization culture="en-us" uiCulture="en"/> to the </system.web> section inside the web.config file. For example:

    <httpHandlers>
       <remove verb="*" path="*.asmx"/>
       <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
       <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      </httpHandlers>
      <httpModules>
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </httpModules>
      <globalization culture="en-us" uiCulture="en"/>

     </system.web>

    Also you can set it on the page by setting Page's Culture property. 

    Hope this helps.

    Best regards,

    Jonathan

     

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (6 items)