精彩专题推荐:建站之入门课 建站之必修课 建站之关键课 网站价值所在 流量提高专题 css+div 标准 个人网站打造全过程
返回建站学首页
导航:
建站首页 | 网站设计 | 网站开发 | 网站运营 | 网页软件 | 建站指南 | 搜索优化 | 图像处理 | 视频教程 | 书籍教程 | 建站专题
当前位置:首页>网站开发>xml教程>正文

XML在ASP中的一些运用


来源: 时间:06-12-25 点击: 点击这里收藏本文

  Response.Write "<BR>Error" & Err.Number
  Response.Write "<BR>" & Err.Description
  Response.Write "<BR>" & Err.Source
  Response.End
 End If
  
 Response.Write "<BR>cnnState=" & scrip.cnnState & "<BR>"
 Response.Write "<BR>Testing ...Write<BR>"
 
 scrip.TestWriteLine ""
 scrip.TestWrite "This is the first part "
 scrip.TestWrite "and this is the second."

 Response.Write "<BR>Testing ...WriteLine<BR>"
 scrip.TestWriteLine "This is text with a line break."
 scrip.TestWriteLine "And so is this."
 %>
上面的代码没有包括<implement type = "ASP"/>, 但是仍然可以访问ASP对象。
因为他们是被当成对象传递给scriptlet.
下面再给出一个很常用的取时间的狸子:

scp_dmy.sct
 <?XML version="1.0"?>
 <scriptlet> 

 <?scriptlet error="true" debug="true"?>

 <registration
     description="scp_dmy"
     progid="scpdmy.Scriptlet"
     version="1.00"
     classid="{bba68a50-3ae0-11d3-a9c0-0080c8034244}"
 >
 </registration> 

 <public>    
     <method name = "option_num">
     <PARAMETER name = "num"/>
     </method>
     <method name = "option_month">
     </method>
     <method name = "option_year">
     </method>
 </public>  

 <implements type="ASP" id="ASP"/>  
 <script language="VBScript">

 <![CDATA][
 Sub option_num(num)
     For i = 1 to num
         If i<10 Then
             x = 0 & i
         Else
             x = i
         End If
         Response.write "<option value = " & x & ">" & x & "</option>"
     Next
 End Sub  

 Sub option_month()
     For i = 1 to 12
         If i<10 Then
             x = 0 & i
         Else
             x = i
         End If
         Response.write "<option value = " & x & ">" & MonthName(x,True) & "</option>"
     Next
 End Sub 

 Sub option_year()
     For i = -1 To 3
         yy = year(DateAdd("yyyy",i,Date()))
         Response.write "<option value = " & yy & ">" & yy & "</option>"
      Next
 End Sub
  
 ]]>
 </script>
  
 </scriptlet>

Dmy_check.asp: 文件
 <%
     Set scrip = Server.CreateObject("scp_dmy.Scriptlet")
 %>

 <html>
 <head></head>
 <body>

 <form name = "form1">
 从 :
 <select name = "D1">
 <option value="">dd</option>
 <% call scrip.option_num(31) %>
 </select>
  
 <select name = "M1">
 <option value="">mm</option>
 <% call scrip.option_month() %>
 </select>

 <select name = "Y1">
 <option value="">yy</option>
 <% call scrip.option_year() %>
9 7 3 1 2 3 4 4 8 :

  把此文章收藏到:          
广而告之
文章搜索
  • Google JZxue.Com

关于我们 | 联系我们 | 友情链接 | 网站地图
Copyright © 2005 - 2006 建站学 All rights reserved.