郁闷的<% %>...大家帮忙
小弟下载了一段源程序回来看, 但那段ASP.NET的代码不是用的codebehind,而是直接在页面上用写代码, 如
<Script Runat="Server">
Dim myconn As OleDbConnection
Dim RecordCount,PageCount,CurrentPage,i As integer
Dim codemessage As string
dim ds as new dataset()
...
我在VS.NET中新建一WEB应用程序,就把这段代码COPY了进去(在视图设计器的HTML中, 我想转到"设计"视图中观看其效果, 可老是弹出这个框:
未能在"设计"视图中打开, 在"<%..."值"....%>"块中,以不同方式将值括起来.
但程序能通过编译, 且能正常运行.只是在VS中看不到效果有那么点不爽的感觉..
调试了一下, 大概是以下区段的代码出问题
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top" >
<hr class="gueststylehr" size="0.1" width="100%">
<a href="<%=ds.Tables("guest").Rows(i)(5)%>" target="_blank"><img src="images/icon/home.gif" width="44" height="16" alt="<%=ds.Tables("guest").Rows(i)(5)%>" border="0"></a>
<a href="http://www.chinagz.net/ip/ipsearch.cgi?ip=<%=f_IP(ds.Tables("guest").Rows(i)(14))%>" target="_blank"><img src="images/icon/ip.gif" align="absmiddle" alt="访客IP:<%=f_IP(ds.Tables("guest").Rows(i)(14))%>" height="16" border="0"></a>
<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=ds.Tables("guest").Rows(i)(3)%>" target="_blank"><img src="images/icon/qq.gif" alt="<%=ds.Tables("guest").Rows(i)(3)%>" border="0" width="35" height="16" ></a>
<a href="mailto:<%=ds.Tables("guest").Rows(i)(4)%>"><img src="images/icon/email.gif" width="42" height="16" border="0" alt="<%=ds.Tables("guest").Rows(i)(4)%>"></a>
<a href="javascript:;" onClick="MM_showHideLayers('admin','','hide','postcontent','','show')"><img src="images/icon/postguest.gif" width="45" height="16" border="0"></a>
<%if session("isadmin")<>"" then %>
<a href="default.aspx?replyid=<%=ds.Tables("guest").Rows(i)(0)%>&caption=<%=ds.Tables("guest").Rows(i)(7)%>"><img src="images/icon/quote.gif" width="45" height="16" border="0" alt="回复这条留言"></a><%if not ISDBNull(ds.Tables("guest").Rows(i)(11)) then%>
<a href="default.aspx?replyid=<%=ds.Tables("guest").Rows(i)(0)%>"><img src="images/icon/EDIT.GIF" width="47" height="16" border="0" alt="编辑回复"></a><%end if%> <a href="default.aspx?del=<%=ds.Tables("guest").Rows(i)(0)%>"><img src="images/icon/del.gif" width="45" height="16" alt="删除这条留言" border="0" ></a>
<%end if%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
大家帮忙想想, 怎样才能去掉这个BUG