I have developed an ASP user control that utilizes the jquery UI datepicker to display a standardized calendar on our website.
Currently, I am working on adding validation to this control to avoid having to implement it on every page where the calendar is used. Is there a way to set Page_IsValid to false directly from the ascx file?
Below is the code snippet:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="jQueryCalendar.ascx.vb" Inherits="Controls_Misc_jQueryCalendar" %>
<style type="text/css">
div.ui-datepicker, div.ui-widget {
font-size: 12px !important;
}
img.ui-datepicker-trigger{
margin-bottom:-5px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('.datepicker').datepicker({
showOn: 'button',
buttonImage: '<%= Me.ImageURL%>',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
showOtherMonths: true,
selectOtherMonths: true,
dateFormat: 'dd/mm/yy'
});
});
</script>