Master page and jquery

1.download latest jqury http://jquery.com/download/

2.download latest jquery.ui, Theme select "Blitzer" http://jqueryui.com/download/#!zThemeParams=5d00000100f305000000000000003d8888d844329a8dfe02723de3e5700bbb34ecf36ce5959f380e613cafa997b39424a52ffc947ae6386d03dcb468a5a6d1623ac0d0e3e18cdf4fca8f2d1c997c7af2b425437a134e5b366f618af5193c1d8772b526c0c53c8f5528cb98c54b6fe385b01ee1763c1d4611100b242ec920a41206d3963eee0327838569a479d191f5adfb7b3ffee4f7265bdf6e03b09d243b90abaeb609b96eee56cef6cc0633865895078988ec40819895711fa7efb93b110f6e1b1b1557039d6178c8824adfa105fdfe1f7011f178cbd9f593de821bf90d0a04f35b5f6ca2fe4ccb9ee832eb806819e5b9aa863e9b8246d16fb230a7cb628f97fc471014be50dac4872e81d9821984e5cb27e4c8026968a9b1e80247bd040d1ef8e047f0ae98998cf329c56654903d9807c1e8c51dcb22b9bb42ca22a9b30ab0c2ae230b6228bbf56f8dbb62a2e49281585710b64c5e25d34da872f883d0d15a3f9716d9f34e297cc883697927ddea3a4e56a1de81985f7db5ee4e62567eaaedcd8b802411687a738bb9921d9eba82ca5c09d328015ecf731114054d32c5cb2354800f07cf72fe329c69ef9a2b9f897e6a0e64abf6d605c0ce92167ab590565246907805b9d96399a15ff8a61c815970937e0cc48650f5e8bd2de19096fe950d8484dff5f18410d74ffdd71567

Site.Master

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="KLSTest.Site" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/Script/jquery-1.11.1.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/Script/jquery-ui-1.11.0.custom/jquery-ui.min.js")%>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/Script/jquery-ui-1.11.0.custom/zh-CN/jquery.ui.datepicker-zh-CN.js")%>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/Script/common_ui.js")%>"></script>
    <link rel="stylesheet" type="text/css" href="<%=ResolveClientUrl("~/Script/jquery-ui-1.11.0.custom/jquery-ui.min.css")%>" />
    <asp:ContentPlaceHolder ID="scripts" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">
        <div>
            <asp:ContentPlaceHolder ID="bodyContent" runat="server">
            </asp:ContentPlaceHolder>
        </div>
    </form>
</body>
</html>

Child Page

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DatePickerTest.aspx.cs" Inherits="KLSTest.DatePickerTest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="scripts" runat="server">
    <script type="text/javascript">
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContent" runat="server">
    <asp:TextBox ID="dateSelect" runat="server" CssClass="jDatePicker"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Button" />
</asp:Content>

DatePicker-zh-CN

jQuery(function ($) {
    $.datepicker.regional[‘zh-CN‘] = {
        closeText: ‘关闭‘,
        prevText: ‘<上月‘,
        nextText: ‘下月>‘,
        currentText: ‘今天‘,
        monthNames: [‘一月‘, ‘二月‘, ‘三月‘, ‘四月‘, ‘五月‘, ‘六月‘,
        ‘七月‘, ‘八月‘, ‘九月‘, ‘十月‘, ‘十一月‘, ‘十二月‘],
        monthNamesShort: [‘一‘, ‘二‘, ‘三‘, ‘四‘, ‘五‘, ‘六‘,
        ‘七‘, ‘八‘, ‘九‘, ‘十‘, ‘十一‘, ‘十二‘],
        dayNames: [‘星期日‘, ‘星期一‘, ‘星期二‘, ‘星期三‘, ‘星期四‘, ‘星期五‘, ‘星期六‘],
        dayNamesShort: [‘周日‘, ‘周一‘, ‘周二‘, ‘周三‘, ‘周四‘, ‘周五‘, ‘周六‘],
        dayNamesMin: [‘日‘, ‘一‘, ‘二‘, ‘三‘, ‘四‘, ‘五‘, ‘六‘],
        weekHeader: ‘周‘,
        dateFormat: ‘yy-mm-dd‘,
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: true,
        yearSuffix: ‘年‘
    };
    $.datepicker.setDefaults($.datepicker.regional[‘zh-CN‘]);
});

DatePicker Initalization common_ui.js

$(function () {
    /*-------------------- Date Picker --------------------------------------------*/
    /*---- how to use: <asp:TextBox ID="TextBox1" runat="server" CssClass="jDatePicker"></asp:TextBox>---*/
    if (!$(‘.jDatePicker‘).hasClass(‘readonly_submit‘)) {
        $(‘.jDatePicker‘).addClass(‘readonly_submit‘);
    }
    $(‘.jDatePicker‘).datepicker({
        showButtonPanel: true,
        beforeShow: function (input) {
            setTimeout(function () {
                var buttonPane = $(input)
                    .datepicker("widget")
                    .find(".ui-datepicker-buttonpane");

                $("<button>", {
                    text: "清除",
                    click: function () {
                        $.datepicker._clearDate(input);
                    }
                }).appendTo(buttonPane).addClass("ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all");
            }, 1);
        },
        onChangeMonthYear: function (year, month, instance) {
            setTimeout(function () {
                var buttonPane = $(instance)
                    .datepicker("widget")
                    .find(".ui-datepicker-buttonpane");

                $("<button>", {
                    text: "清除",
                    click: function () {
                        $.datepicker._clearDate(instance.input);
                    }
                }).appendTo(buttonPane).addClass("ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all");
            }, 1);
        }
    });

    /*-------------------- Input : Readonly but can be submit  --------------------------------------------*/
    /*---- how to use: <asp:TextBox ID="TextBox1" runat="server" CssClass="readonly_submit"></asp:TextBox>---*/
    $(‘.readonly_submit‘).on(‘paste‘, function (e) { e.preventDefault(); return false; });
    $(‘.readonly_submit‘).on(‘keydown‘, function (e) { e.preventDefault(); return false; });
    $(‘.readonly_submit‘).attr(‘autoComplete‘, ‘off‘);
});

Master page and jquery,布布扣,bubuko.com

时间: 2024-10-19 13:05:13

Master page and jquery的相关文章

SharePoint 2013 的Master page 中引入Jquery

SharePoint 2013 的Master page 中引入Jquery 分类: JavaScript SharePoint2013-02-03 22:01 1978人阅读 评论(0) 收藏 举报 design managerjqueryjQueryJQUERYJqueryJQueryMaster pageSharePoint 2013引入 本文讲述如何在SharePoint 2013 的Master page 中引入Jquery. 在SharePoint 2013 的Master page

SharePoint 2013 Deploy Master Page And Page Layout

2013年9月27日的一篇随笔,其实也是自己编写的部署文档,由于客户是HK的,所以描述部分是用英文. 涉及到的内容是关于SharePoint 2013如何部署自定义的母版页和布局页. First, Login to site collection by site collection administrator, and we should click the menu of "Site collection features" in "Site Collection Adm

master page

<?xml version="1.0"?><configuration>  <system.web>    <pages clientIDMode="Static"  masterPageFile="~/MasterPage.master" />  </system.web></configuration> master page

jquery 2.1.0 源码

/*! * jQuery JavaScript Library v2.1.0 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2

jQuery源码解析

( function( global, factory ) { "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) {

[转]Using the HTML5 and jQuery UI Datepicker Popup Calendar with ASP.NET MVC - Part 4

本文转自:http://www.asp.net/mvc/overview/older-versions/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-4 This tutorial will teach you the basics of how

读jQuery源码之三

源码177-527行:jQuery.extend方法 jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof targ

jQuery的性能优化

原文链接:http://www.colotu.com/html/gcs/6.html 现在越来越多的人应用jQuery了,有些同学在享受爽快淋漓coding时就将性能问题忽略了, 比如我. jquery虽在诸多的js类库中性能表现还算优秀, 但毕竟不是在用原生的javascript开发, 性能问题还是需要引起重视的. 1. 总是从ID选择器开始继承 在jquery中最快的选择器是ID选择器. 因为它直接来自于Javascript的getElementById()方法. <div id="c

一个jQuery扩展工具包

带有详尽注释的源代码: var jQuery = jQuery || {}; // TODO // ###################################string操作相关函数################################### jQuery.string = jQuery.string || {}; /** * 对目标字符串进行html解码 * * @name jQuery.string.decodeHTML * @function * @grammar j