请问我写的简单的if else end if 语句,怎么会出现500错误呢?
- C# code
<A title="<%= RS("TITLE") %>" href="show.asp?/<%= RS("id") %>.html" rel="bookmark"><% if Rs("isflash")="0" then response.write"<img src='images/nopic.jpg' border=0 alt='无图片'>" %><%else%><IMG class="alignleft" alt="<%= RS("TITLE") %>" src="<%= RS("images") %>"><%end if %></A>
------解决方案--------------------
你的程序中有respons.write输出,也有=输出,也有HTML中嵌套ASP,也有ASP中嵌套HTML的,建议你统一按一种方式输出
我把你的程序作如下变动,看是否容易看点
- VBScript code
<% If Rs("isflash")="0" Then str = "<img src='images/nopic.jpg' border=0 alt='无图片'>" Else str = "<IMG class='alignleft' alt='"& RS("TITLE") &"' src='"& RS("images")&"'" End If %> <A title="<%= RS("TITLE") %>" href="show.asp?/<%= RS("id") %>.html" rel="bookmark"><%=str%></A>