Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: MaskedEdit not working in April 2013 release [27419]

$
0
0
I have a problem’s with new version (April 2013) of MaskedEdit. Date and Time value is not verified, TextBox is not cleared on wrong value and also on exit from TextBox stays __.__.____. The same happened when I use code from sample page with new version of AjaxControlToolkit.dll. What I’m doing wrong?
My code:
```
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" LoadScriptsBeforeUI="false"
EnablePageMethods="true" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true">
</ajaxToolkit:ToolkitScriptManager>
<div>
<asp:TextBox ID="txtDate" runat="server" Width="78px"></asp:TextBox>
<asp:ImageButton ID="ibKoledar" runat="server" CausesValidation="False" ImageAlign="AbsMiddle" />
<asp:TextBox ID="txtTime" runat="server" Width="42px"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="calendarExtenderDatum" runat="server" CssClass="Koledar" Format="dd.MM.yyyy"
PopupButtonID="ibKoledar" TargetControlID="txtDate" FirstDayOfWeek="Monday">
</ajaxToolkit:CalendarExtender>
<ajaxToolkit:MaskedEditExtender EnableViewState="false" ID="meeDate" runat="server" Century="2000" ClearTextOnInvalid="True" ClipboardEnabled="False" CultureDateFormat="dd.MM.yyyy"
CultureName="sl-SI" Mask="99/99/9999" MaskType="Date" TargetControlID="txtDate">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:MaskedEditValidator EnableViewState="false" ID="mevDatum" runat="server" ControlExtender="meeDate" ControlToValidate="txtDate" Display="Dynamic"></ajaxToolkit:MaskedEditValidator>
<ajaxToolkit:MaskedEditExtender EnableViewState="false" ID="meeTime" runat="server" AutoComplete="true" ClearTextOnInvalid="True" Mask="99:99" MaskType="Time" TargetControlID="txtTime"></ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:MaskedEditValidator EnableViewState="false" ID="mevTime" runat="server" ControlExtender="meeTime" ControlToValidate="txtTime" Display="Dynamic"></ajaxToolkit:MaskedEditValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
```
Comments: I have the same problem. I have a MaskedEditValidator with MaskedEditExtender on my page which has been working for 2 years. Today I updated the AjaxControlToolKit to the April release and now it is not excepting dates after the set minimal value. Example: I have the minimal value set to "today.ToShortDateString" and every date that is today or in the future is not accepted. Dates before the minimal value is accepted while it shouldn't. If I remove the minimal value and set the maximum value to today, then validation summary shows a bullet but no error text. My code: ``` txtRequestDeliveryDate = New TextBox txtRequestDeliveryDate.Style("position") = "Absolute" txtRequestDeliveryDate.Style("top") = "40px" txtRequestDeliveryDate.Style("left") = "505px" txtRequestDeliveryDate.Style("width") = "80px" txtRequestDeliveryDate.ID = "txtRequestDeliveryDate" txtRequestDeliveryDate.Font.Name = "Arial" txtRequestDeliveryDate.Font.Size = 9 txtRequestDeliveryDate.ReadOnly = False txtRequestDeliveryDate.AutoPostBack = False pn.Controls.Add(txtRequestDeliveryDate) Dim btRequestDeliveryDate As New Image btRequestDeliveryDate.Style("position") = "Absolute" btRequestDeliveryDate.Style("top") = "40px" btRequestDeliveryDate.Style("left") = "590px" btRequestDeliveryDate.Style("width") = "18px" btRequestDeliveryDate.ID = "btRequestDeliveryDate" btRequestDeliveryDate.ImageUrl = "images\cal.gif" pn.Controls.Add(btRequestDeliveryDate) dtRequestDeliveryDate = New CalendarExtender dtRequestDeliveryDate.Animated = True dtRequestDeliveryDate.ClearTime = True dtRequestDeliveryDate.ID = "dtRequestDeliveryDate" dtRequestDeliveryDate.PopupButtonID = "btRequestDeliveryDate" dtRequestDeliveryDate.PopupPosition = CalendarPosition.BottomRight dtRequestDeliveryDate.TargetControlID = "txtRequestDeliveryDate" dtRequestDeliveryDate.Format = "dd-MM-yyyy" dtRequestDeliveryDate.DefaultView = CalendarDefaultView.Days dtRequestDeliveryDate.EnableClientState = True dtRequestDeliveryDate.EnabledOnClient = True dtRequestDeliveryDate.EnableViewState = True dtRequestDeliveryDate.TodaysDateFormat = "dd-MM-yyyy" pn.Controls.Add(dtRequestDeliveryDate) Dim mexDeliveryDate As New MaskedEditExtender mexDeliveryDate.CultureName = "nl-NL" mexDeliveryDate.AutoComplete = False mexDeliveryDate.Mask = "99/99/9999" mexDeliveryDate.MaskType = MaskedEditType.Date mexDeliveryDate.PromptCharacter = "_" mexDeliveryDate.ID = "mexDeliveryDate" mexDeliveryDate.TargetControlID = "txtRequestDeliveryDate" mexDeliveryDate.ClearTextOnInvalid = True mexDeliveryDate.MessageValidatorTip = True mexDeliveryDate.InputDirection = MaskedEditInputDirection.LeftToRight mexDeliveryDate.ErrorTooltipEnabled = True pn.Controls.Add(mexDeliveryDate) Dim mevDeliveryDate As New MaskedEditValidator mevDeliveryDate.ControlExtender = "mexDeliveryDate" mevDeliveryDate.ControlToValidate = "txtRequestDeliveryDate" mevDeliveryDate.ValidationExpression = "^(([0]?[1-9]|[12][0-9]|3[01])[- /.]([0]?[1-9]|1[012])[- /.](19|20)\d\d)|((1[012]|0[1-9])(3[01]|2\d|1\d|0[1-9])(19|20)\d\d)$" mevDeliveryDate.ID = "mevDeliveryDate" mevDeliveryDate.IsValidEmpty = True mevDeliveryDate.InvalidValueBlurredMessage = "This date is not correct or in the past." mevDeliveryDate.InvalidValueMessage = "This date is not correct or in the past." mevDeliveryDate.MinimumValueMessage = "This date is in the past!" mevDeliveryDate.ErrorMessage = "The delivery date is not set." mevDeliveryDate.Display = ValidatorDisplay.Static mevDeliveryDate.MinimumValue = Today.ToShortDateString 'mevDeliveryDate.MaximumValue = Today.ToShortDateString mevDeliveryDate.Text = "*" mevDeliveryDate.Style("position") = "absolute" mevDeliveryDate.Style("left") = "40px" mevDeliveryDate.Style("top") = "515px" mevDeliveryDate.Style("width") = "180px" mevDeliveryDate.Font.Name = "Arial" mevDeliveryDate.Font.Size = 18 mevDeliveryDate.ForeColor = Drawing.Color.Red mevDeliveryDate.ValidationGroup = "req" pn.Controls.Add(mevDeliveryDate) rvDeliveryDate = New RequiredFieldValidator rvDeliveryDate.ID = "rvDeliveryDate" rvDeliveryDate.ErrorMessage = "The delivery date is not set." rvDeliveryDate.ValidationGroup = "req" rvDeliveryDate.ControlToValidate = "txtRequestDeliveryDate" rvDeliveryDate.Style("position") = "Absolute" rvDeliveryDate.Style("top") = "40px" rvDeliveryDate.Style("left") = "495px" rvDeliveryDate.Style("width") = "10px" rvDeliveryDate.Font.Name = "Arial" rvDeliveryDate.Font.Size = 18 rvDeliveryDate.ForeColor = Drawing.Color.Red rvDeliveryDate.Text = "*" pn.Controls.Add(rvDeliveryDate) ```

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>