asp.net calendar control firing validation controls - c#

I have a set of validation controls on my asp.net page, to validate values in textfields. I also have a calendar control on the same page. When I click on the calendar image, the validation control message box pops up. How can I avoid that from appearing when the calendar icon is clicked?

Perhaps try to put the calendar control into a different ValidationGroup than the other controls.
If it is not in a validation group and the other controls aren't either, try to set a validation group for the other controls.

You can either use validation groups or if you don't want it to ever trigger validation set CausesValidation = false

Related

How to stop required field validation for master page's textbox at the time of submitting default form

When i try to submit the form which is in the default page but same time master page Textbox alerts for input. How to avoid this required field validation.?
If the field on the Master Page is never required, removing the validator from that field will avoid the issue.
If the field on the Master Page is required, but not when the controls on the page postback, then set a different ValidationGroup for the buttons/fields on the page and on the Master Page. ValidationGroups allow you to validate multiple groups of controls depending on which control triggers the postback. They can even be set programmatically, making them very flexible.

Is it possible to have a Textbox show calendar dropdown?

Without place a TextBox over a Calendar control and hiding/showing controls and synchronizing values between controls, is it possible to have a Textbox and a button next to it, that when clicked, shows the calendar dropdown?
I would use the DateTimePicker control, however I want to set the value to NULL without having to show & use the checkbox.
I also want that the control is empty without any default date which is grayed out.
Implementing a custom control based on this answer is trivial, but I was wondering if a calendar dropdown can be shown without the need to have a hidden DateTimePicker.
This is pretty much the definition of a DateTimePicker...

Telerik RadControls RadFormDecorator - Tow Problem About Positioning

i am using asp.net with c# web app in vs 2008
problem 1:
i do not know why Telerik RadControls- RadFormDecorator Moves some controls (such as Buttons or chech boxes) and changes their positioning up or down in my form after viewing in browser...
i put those controls in a cell of a table ... but not help
i had this problem about radajaxmanager and by setting UpdatePanelsRenderMode property to inline problem solved - but here there is no property like that...
what is going on here?
problem2:
i decorated my buttons and chechboxes with radformdecorator (telerik radcontrols) control...
when i click on a checkbox to set it to true or false so my webpage positioning goes to up (like when postback occurs , but this is not postback)
how can i prevent this problem ?
thanks for attention
This happens in some scenarios because of the way RadFormDecorator styles checkboxes - real checkboxes are hidden outside of the viewport. When the decorated checkbox is clicked however, browsers try to focus the real checkbox, hence the "jumping". To avoid that, you should set position:relative to the parent container.

More than a ASP:Wizard control

How can one have more than a Wizard control on the same page without the "RequiredFieldValidator" will affect the other Wizard control?
Set the ValidationGroup property on all validators that should be grouped together, and call the Page.Validate(String) with the name of the validation group you want to validate.
You may need to disable clientside validation for this to work properly.

How to use the Validator controls with controls other than TextBox?

I want to use the Validator control to validate a FCKEditor rich text control. Is there a way to do this on either client and/or server side?
And a broader question, is there a way to use the Validator controls for anything other than text boxes?
You can use CustomValidator control to perform custom validation logic. This control actually doesn't even require ControlToValidate to be set.
It is possible to use a
CustomValidator control without
setting the ControlToValidate
property. This is commonly done when
you are validating multiple input
controls or validating input controls
that cannot be used with validation
controls, such as the CheckBox
control.

Categories

Resources