I have an ajax calendar extender, but there is a problem. Todays date is always highlighted no matter what, so if i go to pick a date it comes out as this:
todays date/d/year
And no matter what date i pick it will always end up as the chosen date is todays date, then the month as the date you picked?
which i dont want...
Can anyone help me please?
<asp:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" TargetControlID="txtDOB"></asp:CalendarExtender>
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MessageValidatorTip="true" ClearMaskOnLostFocus="true" CultureName="en-GB"
Mask="99/99/9999"
MaskType="Date"
AcceptNegative="None"
TargetControlID="txtDOB"
/>
<asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1" ErrorMessage="Incorrect date"
ControlToValidate="txtDOB"
EmptyValueMessage="Date is required"
InvalidValueMessage="Date is invalid"
Display="Dynamic"
TooltipMessage="Input a date"
EmptyValueBlurredText="*"
InvalidValueBlurredMessage="Invalid date"
>
</asp:MaskedEditValidator>
Never mind i have solved it, it was due to one of those weird glitches that i experience once in a while with visual studio. Simply copying and pasting the code in again, and it was working.
Related
we have application which is accessed worldwide. and we set the default date format. The server set the time zone of the San Fransisco. Here the control used to display date in mm/dd/yyyy
<telerik:RadDatePicker Width="90" x:Name="dtpCashflowDate" Height="18" DateTimeText="{Binding Path=NewTransferDetail.TransferDate,Mode=TwoWay,ValidatesOnDataErrors=True,StringFormat=\{0:d\}}" InputMode="DatePicker">
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<ei:CallMethodAction MethodName="NewRecord_GotFocus" TargetObject="{Binding}" ></ei:CallMethodAction>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadDatePicker>
Now one of the organization office in Bangkok show the date in dd/mm/yyyy. How its possible.
With StringFormat=\{0:d\} you set the control to show the short date pattern.
If your application is set in another culture the short date will change accordingly.
Please control which format you need in this microsoft article, then change the StringFormat or the Culture property in the way you need.
Remember: you can also set the format in all the istances of your application by specifying a custom format, regardless of the culture of your application, by setting StringFormat=\{0:mm/dd/yyyy\}.
This is because of the culture that is set to the DatePicker..
<telerik:RadDatePicker culture="jap">
or the culture for bangkok(japanese in this case), Uses the default format used by that culture.
I am wondering if there is any way to stop Visual Studio 2010 from appending a number to the end of the ID on new controls I create. For example, when I add a new TextBox, I would prefer that it do this:
<asp:TextBox ID="TextBox" runat="server">
<asp:TextBox ID="TextBox" runat="server">
<asp:TextBox ID="TextBox" runat="server">
Instead of this:
<asp:TextBox ID="TextBox1" runat="server">
<asp:TextBox ID="TextBox2" runat="server">
<asp:TextBox ID="TextBox3" runat="server">
It would make it easier to rename them appropriately, so I don't have to arrow/mouse over and delete the number each time. As I was writing this, the "Questions that may already have your answer" suggested this:
How do I prevent Visual Studio from renaming my controls?
which admittedly was the biggest part of my annoyance, but that appears to turn off putting in an ID="" field altogether, not just for pasted controls. It would still be helpful to turn off the numbering for new, non-pasted controls and have it not rename pasted ones as well. At the moment I'm working with ASP.NET, but it would be nice if it there was a way to do it for WinForms as well.
Before anyone suggests it, I do know that allowing it to append the numbers prevents name conflicts should I not rename them appropriately. However, I would much rather have it fail to compile so I know to fix the issue now (if I forget to name something properly) rather than find random "TextBox1" items lying around in the code later on.
in visual studio goto:
Tools > Options > Text Editor > HTML > Miscellaneous
Uncheck 'Auto ID elements on paste in Source view'.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
When using the DatePicker JuiceUI control the text field used to store the value does not retain its value upon postback. The DatePicker control is set as follows;
<asp:TextBox ID="txt_DueDate" Type="date" MaxLength="50" CssClass="requiredField" Width="75" runat="server" />
<Juice:Datepicker ID="dp_DueDate" TargetControlID="txt_DueDate" ButtonImage="/images/signs/ico_calendar.gif" DateFormat="dd/mm/yy" ButtonImageOnly="true" ShowOn="both" ButtonText="Select date" runat="server" />
Apart from adding the DatePicker control and the Type="date" attribute to the text box, this text box stored the value from a previous javascript only date picker and maintained it's value after postback.
Is there a attribute I am missing on either of these controls to make viewstate work again?
I tested the code you provided in a new page with a single button and the textbox retained the value set by the datepicker on postback initiated by an asp:button. There must be something else in your code resetting the value of the textbox.
I want to change next example:
http://livedemo.exadel.com/richfaces-demo/richfaces/calendar.jsf?tab=organizer&cid=1157294
to have ability to set up weekends and hollydays.
And I have q few questions:
1) why I could use data.shortDescription/data.description in the next code:
<div>
<h:outputText value="{data.shortDescription.escapeHTML()}" />
</div>
<div>
<h:outputText value="{data.description.escapeHTML()}"/>
</div>
Can I use something else to show the text in the current date?
I want to add boolean isDayOff field to CalendarDataModelItemImpl, but I don't know, how I will retrieve it and show, and also save.
How can I set up or cancel weekends using richfaces Calendar (maybe using dataModel maybe not)
Could anyone give me some ideas or example?
Also I need to show this new weekends with red color.
You can change the style of each day, using the dayStyleClass attribute. It should point to a javascript function, that takes an argument day and returns a css class selector. Check the "client side disable/styling" tab of the examples.
I am building a User Control (requirement – has to be User Control).
This user control is inside an AJAX Update Panel on the parent page.
The user control has two Infragistics Web Date Chooser controls on it.
Both dates are required.
I have placed asp.net RequiredFieldValicators on both controls.
I have placed ValidatorCalloutExtenders on both.
One control gets validated every time without fail. The other is intermittent. To debug I first removed the ValidatorCalloutExtender from the failing control and sure enough the RequiredFieldValidator fires correctly every time so it appears that the problem is with the ValidatorCalloutExtender. There are not a lot of options for the ValidatorCalloutExtender but I did play with them every way feasible and nothing seems to make any difference. The TargetControlID has to point to the validation control you are extending. Any help appreciated.
Here is the code that works correctly every time:
<igsch:WebDateChooser ID="wdcEndDatePop" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
Width="200px" MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvEndDate" runat="server"
ControlToValidate="wdcEndDatePop" Display="None"
ErrorMessage="End date required." ValidationGroup="endDatePop" />
<cc1:ValidatorCalloutExtender
ID="vceEndDatePop"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvEndDate"
WarningIconImageUrl="~/images/back_warning2.gif" />
And here is the code that works intermitemtly:
<igsch:WebDateChooser ID="wdcStartDate" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvStartDate" runat="server"
ControlToValidate="wdcStartDate" Display="None"
ErrorMessage="Start date required." ValidationGroup="access" />
<cc1:ValidatorCalloutExtender
ID="vceStartDate"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvStartDate"
WarningIconImageUrl="~/images/back_warning2.gif" />