在html页面怎样实现asp页面<%.......%>

xiwangzhiguang88608 2010-07-26 11:31:24
在asp页面脚本都是写在<%....%>里边的 ,那么在html页面怎样实现asp页面的<%..........%>,望各位同仁指教,谢谢
...全文
321 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
youngsheep 2010-08-05
  • 打赏
  • 举报
回复
呵呵,他自己都说不清楚自己要的是什么

我给你完整的答案

1. <%%>是 asp的标识符,需要IIS的支持,使用asp.dll来解释的,所以基本上只能安装在服务器端,IE不会解释这个标识符的。

2. 想要在前端实现vbscript代码,使用 <script language="vbscript"></script>来撰写,这个就可以实现在客户端运行vb脚本的功能了,比如

<script language="vbscript">
msgbox "hello world.."
</script>
as123456789d 2010-08-05
  • 打赏
  • 举报
回复
可以的 你是JS调用 ASP吗

调用格式 <script language="javascript" src="xxx.asp"></script>

wcwtitxu 2010-08-05
  • 打赏
  • 举报
回复
修改 iis 配置。

把 *.html 文件映射给 %windir%\system32\inetsrv\asp.dll 处理
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 ftiger 的回复:]
不是很明白你的要求。
javascript的思路与asp不完全一样。用asp这种文本流方案也行,不过更方便方案是进行dom操作。

例子
<div id="mydiv"></div>


<script language="javascript">
document.getElementById('mydiv').innerHTML="Hello world";
</script……
[/Quote]
就是在html页面实现asp页面脚本<%.....%>的效果
gentle_sword 2010-07-26
  • 打赏
  • 举报
回复
不行的,还是用asp吧
ftiger 2010-07-26
  • 打赏
  • 举报
回复
不是很明白你的要求。
javascript的思路与asp不完全一样。用asp这种文本流方案也行,不过更方便方案是进行dom操作。

例子
<div id="mydiv"></div>


<script language="javascript">
document.getElementById('mydiv').innerHTML="Hello world";
</script>
  • 打赏
  • 举报
回复
没有人吗? 我知道一种是写在
<script language="javascript">
</script>
可是这样的写法不能完全实现asp页面的<%%>效果
例如下边的分页效果 <table>是夹在两个"<%%><%%>"之间的

<%
if page<>"" then
currentPage=cint(page)
else
currentPage=1
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from "&sysfilename&"newsmment where AicleID="&ID&" and Pased=1 order by CommentID desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<li>信息正在更新中...</li>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
else
currentPage=1
showContent
end if
end if
sub showContent
dim ArticleNum,aryReturn,ip
ArticleNum=0
do while not rs.eof
aryReturn = Split(rs("ip"),".")
ip=aryReturn(0)&"."&aryReturn(1)&"."&aryReturn(2)&".*"%>
<table width="720" border="0" cellspacing="0" cellpadding="0" style="border-bottom:#999999 1px dashed;">
<tr>
<td>网友:<%=ip%> 于 <%=rs("WriteTime")%> 发表评论,内容如下:</td>
</tr>
<tr>
<td style="text-indent:2em;"><%=rs("content")%></td>
</tr>
</table>
<%ArticleNum=ArticleNum+1
if ArticleNum>=MaxPerPage then exit do
rs.movenext
loop
end sub
rs.close
set rs=nothing
end if
%>

ChinaXtHuLang 2010-07-26
  • 打赏
  • 举报
回复
用AJAX吧
diaomouse 2010-07-26
  • 打赏
  • 举报
回复
<%%>asp代码,,.net也如此,
楼主ID太长了,,
xfpx 2010-07-26
  • 打赏
  • 举报
回复
没弄明白楼主的问题。
你是指是纯html页面吗?那就不能用<%.....%>,只能用脚本了。

或许你可以看下这个
客户端静态页面玩分页
http://blog.csdn.net/ytbada/archive/2007/04/13/1563561.aspx
blueidea_liu 2010-07-26
  • 打赏
  • 举报
回复
我不懂你为什么不做成asp页面
sntdk 2010-07-26
  • 打赏
  • 举报
回复
用ajax
slmintg 2010-07-26
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 xiwangzhiguang88608 的回复:]

就是在html页面实现asp页面脚本<%.....%>的效果
[/Quote]

html是一种描述型语言 你要在html页面实现asp页面"部分的"效果,可以使用javascript
qlzhu1991 2010-07-26
  • 打赏
  • 举报
回复
顶下。。。。。。。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧