1
我有一個ASP用戶控件,它基本上使用jquery UI日期選擇器,只是我們會在整個站點中使用標準日曆。將Page.IsValid設置爲False
我想創建一個驗證這個控件,所以我不必在每個頁面使用日曆創建驗證。是否有可能從ascx中將Page_IsValid設置爲false?
下面的代碼:
<%@ 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>
我有一個文本框,沒有意識到我沒有在問題中包含它,我的道歉。 我不知道我怎麼沒有考慮把驗證器放在控件本身內,謝謝。 – 2011-03-16 10:08:22