• ASP教程
  • PHP教程 JSP教程 CGI教程 XML教程 ASP.NET教程 JAVA教程
    当前位置:教程网 > 程序设计 > ASP教程 > 正文

    带日期标注的日历控件

    编辑:教程网 来源:网络 时间:2011年07月20日 15:43
    控件名称:Calendar with Date Mark
    版 本:1.0
    类 型:HTML Component
    运行需求:IE 5(推荐IE5.5或更高版本)、MSXML、ASP或ASP.NET(后台)
    费 用:免费
    支 持:不提供支持
    源 代 码:XML Scriptlet
    ------------------------------------------------------------------------
    <public:attach event="oncontentready" onevent="init()"/>
    <public:property name="value" get="getValue" put="setValue"/>
    <public:property name="stringValue" get="getStringValue" />
    <public:property name="mark" get="getCurrentMark" put="setCurrentMark" />
    <public:property name="markList" get="getMarkList" />
    <public:method name="refresh" />
    <public:method name="addMark" />
    <public:method name="removeMark" />
    <public:method name="removeAllMark" />
    <public:method name="loadMark" />
    <public:method name="saveMark" />
    <public:event name="onvaluechange" id="vlcg" />
    <script language="JScript">

    //----------------------------------------------------------------
    // HTML Component : Calendar with date mark(带时间标注的日历控件)
    //
    // Version : 1.0
    //
    // Request : Microsoft IE 5 or up
    //
    // Author : JoJo
    //
    // Last Realse : 5/9/2001
    //
    // Copyright : Think Space Soft Tec
    //
    // Contact : thinkspace@163.net
    //----------------------------------------------------------------

    var date = new Date();
    var activeDate = new Date();

    var marklist = new ActiveXObject("Scripting.Dictionary");

    function WriteXMLToDictionary(xmldoc,dict,rewrite){
    var xnodelist = xmldoc.documentElement.selectNodes("Mark");
    if (rewrite) dict.RemoveAll();
    for (var i=0;i<xnodelist.length;i++){
    var xnode = xnodelist.item(i);
    var xdate = xnode.selectSingleNode("MarkDate");
    var xnote = xnode.selectSingleNode("Note");
    //alert(xdate.text + "," + xnote.text);
    if (xdate.text && xnote.text){
    dict.item(xdate.text) = xnote.text;
    }
    }
    }

    function postxml(xmldoc,url){
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open("POST",url,false);
    xmlhttp.Send(xmldoc);
    var xdoc = new ActiveXObject("Microsoft.XMLDom");
    xdoc.async = false;
    xdoc.loadXML(xmlhttp.responseText);
    return !!xdoc.documentElement.text;
    }

    function saveMark(url){
    var xmldoc = new ActiveXObject("Microsoft.XMLDom");
    WriteDictionaryToXML(marklist,xmldoc);
    if(postxml(xmldoc,url)){
    refresh();
    sendEvent();
    return true;
    }
    return false;
    }

    function WriteDictionaryToXML(dict,xmldoc){
    xmldoc.loadXML("<MarkList/>");
    var keys = (new VBArray(dict.Keys())).toArray();
    for (var i=0;i<keys.length;i++){
    try{
    var d = new Date(keys[i]);
    }catch(e){
    continue;
    }
    if (!dict.item(keys[i])) continue;
    var xmark = xmldoc.createElement("Mark");
    var xmarkdate = xmldoc.createElement("MarkDate");

  • 原文来自 教程网-免费ps教程,cad教程,ppt教程,ppt教程,java教程,vb教程,php教程技术在线学习课程网 转载请注明:http://www.websmill.com/chengxu/ASP/11816.html

  • 上一篇:ASP中页面限权访问的几种方法
  • 下一篇:测试客户端屏幕状况