| 域名空间 下载中心 社区论坛 信息公告 MY小屋 |
![]() |
联系我们 设为首页 加入收藏 |
|
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿 论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图 专题 | 应用软件 | 聊天通讯 | Q Q 专栏 | 建站经验 | 在线工具 | 站长Club | 注 册 表 | 旧版 社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务 |
| 新版上线![旧版] | |||||
注:打开慢时请稍等
从ASP迁移至ASP+ --急不可耐了?转换其他的页面吧http://www.iyit.net 日期:2006-6-12 2:01:26 来源: 点击: |
作 者 : 雨晨
'检查是否提供优惠 If rsSessions("Special") = True Then '若本课程提供优惠,则输出“Special Offer!” Response.Write "< td valign=top align=center>" & vbCrLf Response.Write "< a href=""classdetail.asp?SessionID=" Response.Write rsSessions("SessionID") Response.Write """name=""Click for more detail"">" Response.Write "Special Offer!" Response.Write "< /td>" Else '若本课程不提供优惠,则在栏中输出"--" Response.Write "< td valign=top align=center>--< /td>" End If 为了在ASP+中达到同样的效果,我们使用了一个函数。在脚本块中,位于Page_Load 事件下,我们创建以下代码: Function CheckSpecial(ByRef blnSpecial As Boolean, _ ByRef intNumber As Integer) As String If blnSpecial = True Then CheckSpecial = "< a href=" & Chr(34) & _ "classdetail.aspx?SessionID=" & _ intNumber & Chr(34) & ">Special!!< /a>" Else CheckSpecial = "--" End If End Function 然后只须从ASP+ Repeater中调用函数: < template name = "ItemTemplate"> < tr> [ other data being displayed ] < td valign=top align=center> < %=CheckSpecial(Container.DataItem("Special"), Container.DataItem("Session_ID"))%> < /td> < /tr> < /template> Container指的是涉及我们的ASP+ Reapter控件的数据的父对象。通过调用Container.DataItem("Special")及Container.DataItem("Session_ID") ,将父对象(即ASP+ Repeater控件)中的列的值传递给了函数。 编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部] 上一篇:从ASP迁移至ASP+ --处理会话变量(Session Variables) 下一篇:从ASP迁移至ASP+ --将HTML表格转换为ASP+数据列表 转载请注明来源:www.iyit.net 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 最新更新 | 热点排行 | 推荐新闻 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 友情链接 | ||||||
| 设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
| |||||||