jQuery禁用asp.net中的日期 [英] jquery to disable dates in asp.net

查看:59
本文介绍了jQuery禁用asp.net中的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
这是jquery中日历控件的代码.


如果我在.aspx页中添加此代码,就可以正常工作,但是如果我在
中添加此代码
用户控制它不起作用.

让我知道解决方案.

下面给出了代码

Hi all,
this is a code for calendar control in jquery.


if i add this code in .aspx page it is woking fine but if i add this code in

user control it is not working .

Let me know the solution for this.

the below is given code

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
      <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
 <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        $("<%=TextBox1.clientid%>").datepicker({
            dateFormat: 'mm/dd/yy',
            buttonImage: '/images/folders/date.png',
            buttonText: 'Choose date',
            firstDay: 1,
            buttonImageOnly: true,
            showOn: 'both',
            showAnim: 'fadeIn',
            minDate: '0',
            maxDate: +30,
            onSelect: function() { $(this).trigger("onchange", null); }
        });
      });
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    <div>
        <asp:TextBox id="TextBox1" runat="server" Text="" ReadOnly ="true"> </asp:TextBox>

        </div>
    </form>
</body>
</html>

推荐答案

(document).ready(function(){
(document).ready(function() {


("%> ").datepicker({ dateFormat:"mm/dd/yy", buttonImage:"/images/folders/date.png", buttonText:选择日期", firstDay:1 buttonImageOnly:正确, showOn:'both', showAnim:'fadeIn', minDate:'0', maxDate:+30, onSelect:function(){
("<%=TextBox1.clientid%>").datepicker({ dateFormat: 'mm/dd/yy', buttonImage: '/images/folders/date.png', buttonText: 'Choose date', firstDay: 1, buttonImageOnly: true, showOn: 'both', showAnim: 'fadeIn', minDate: '0', maxDate: +30, onSelect: function() {


(this).trigger("onchange",null); } }); }); < /script > < /head > < 正文 > < 表单 =" form1" runat >服务器" > < div > < /div > < div > < asp:TextBox id =" runat 服务器" 文本 " 只读 =" true" < /asp:TextBox > < /div > < /form > < /body > < /html >
(this).trigger("onchange", null); } }); }); </script> </head> <body> <form id="form1" runat="server"> <div> </div> <div> <asp:TextBox id="TextBox1" runat="server" Text="" ReadOnly ="true"> </asp:TextBox> </div> </form> </body> </html>


这篇关于jQuery禁用asp.net中的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆