动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   Asp → 阅读文章

 转换ASP到ASP+

作者来源: 
阅读 2884 人次 , 2000-9-1 

Converting to ASP+
The conversion process from ASP to ASP+ will depend on the complexity of your existing pages. Databases,
hence ADO, is a great example. ADO is now ADO+ and much different. Therefore if you want your database
pages to be ADO+ ASP+ pages, the learning curve is a little steeper. Your old code will work in most cases
with minimal adjustments (mainly structure).

Structure
The way you write your classic ASP pages will determine the level of technicality in converting your
classic ASP pages to ASP+. VBScript is a subset of VB but not the same as VB therefore minor changes,
mainly formatting, will be required. Structure will be the biggest issue. Get used to the Object Oriented
World. And get used to seeing cleaner code. VB and HTML coding must be separated where as with VBScript
you could intertwine it with HTML.

Mix and match HTML/VBScript
If you do this a lot inside your Functions and Subs,


<%
URL = request.servervariables("URL")
%>
<FONT FACE="arial" SIZE="2">
The URL was <%=URL%>


Then you have work to do. ASP+/VB does not allow ASP code to be mixed with HTML freely inside of functions
and Subroutines. They must be separated. In order for this to run in ASP+, all lines must be converted to
VB response.write statements. Not VBScript response.write statements. Notice the parenthesis. This will be
the most cumbersome part of converting ASP pages to ASP+ pages.

This would be the proper way with ASP+/VB


URL = request.servervariables("URL")
response.write ("<FONT FACE=""arial"" SIZE=""2"">)
response.write ("The URL was "& URL & "</FONT>")



Function Calls

With VBScript/ASP you write your functions like this

<%
Function doIt()
response.write ("Yes")
End Function


Function doIt2()
response.write ("Yes")
End Function%>

The following way is how you will need to write your functions in ASP+/VB. The most important thing here
is the <SCRIPT> tags.


<SCRIPT LANGUAGE="VB" RUNAT="server">

Function doIt()
response.write ("Yes")
End Function


Function doIt2()
response.write ("No")
End Function


</SCRIPT>
  

 本文TagsC#  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:最新的关于Cookies的操作
· 下一篇:高级表单验证(转)-针对多次提交表单
· JScript 方法 - getUTCFullYear 方法
· ASP进阶之文章在线管理更新(三)
· asp中对ip进行过滤限制函数
· ASP+全新接触(4)
· asp实现在web中显示电子表格数据(一)显示数据表格的应用


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077