iT邦幫忙

0

asp case數量限制

各位大大好:

我在網頁上用用asp寫選單,case 1.0~1.6時轉換都很正常,但是只要新增多一個例如1.7點選選單就會lock住,只會跑出同一個畫面(直接切換到<%case else%> ),不能切換,我自己看語法好像也沒寫錯>"<想請問是甚麼問題呢? 謝謝!

asp 本文

<!-- #include file="hrefMgr1.txt"--> 
<div id="side_bar">
<h1>系友同學會</h1>
<div class="list">
<a href="<%=getHref("活動宗旨",0)%>"><img src="images/schedule.png"></a>
<h3>行程表</h3>
</div>
<div class="cle"></div>
<div class="list">
<a href="<%=getHref("紀念衣服",0)%>"><img src="images/cup.jpg"></a>
<h3>三件式濾茶杯</h3>
</div>
<div class="cle"></div>
<div class="list">
<a href="<%=getHref("地點位置",0)%>"><img src="images/maps.jpg"></a>
<h3>活動地點</h3>
</div>

<div class="cle"></div>
<div class="list">
<a href="<%=getHref("住宿資訊",0)%>"><img src="images/maps.jpg"></a>
<h3>住宿與交通</h3>
</div>

<div class="cle"></div>
<div class="list">
<a href="<%=getHref("報名人數",0)%>"><img src="images/people.png"></a>
<h3>參加者查詢</h3>
</div>

<div class="cle"></div>
<div class="list1">
<a href="<%=getHref("寫回網頁",0)%>"><img src="images/sign.png"></a>
<h3>報名網頁</h3>
</div>
<div class="cle"></div>
</div>


<div id="content">
<h1>詳情介紹</h1>
<div id="content_p">
<%
select case PNO
%>    
<% case "1.0":%>				
<!-- #include file="./schedule1.html"-->  
<% case "1.1":%>				
<!-- #include file="./cloth1.html"-->
<% case "1.2":%>				
<!-- #include file="./sign.asp"-->
<% case "1.3":%>				
<!-- #include file="./location.html"-->
<% case "1.4":%>				
<!-- #include file="./bye.asp"-->
<% case "1.5":%>				
<!-- #include file="./registst_wr.asp"-->    
<% case "1.6":%>				
<!-- #include file="./member.asp"-->
<% case "1.7":%>				
<!-- #include file="./123.html"-->    
<%case else%>           
<!-- #include file="./schedule1.html"-->
<%end select%> 
</div>
</div>

asp網頁讀檔hrefMgr1.txt

<%
function  getHref(title,level)
  Const ForReading = 1, ForWriting = 2, ForAppending = 8
  Dim fso, f,sno,isno,ssno,fln
  nl=chr(13)&chr(10)'13歸位字元 10換行字元以达到强制换行的效果
  ls="./"
  for i=1 to level
      ls=ls&"../"
  next    
'  on error resume next
  Set fso = CreateObject("Scripting.FileSystemObject")'創建文件
  fln = server.mappath(ls&"href.txt")  
  Set f = fso.OpenTextFile(fln, ForReading)
  if err.number <> 0 then
'      response.write "["&fln&"]<br>"
'      response.write "["&ls&"]<br>"
'      response.write "["&level&"]<br>"
      response.end
  end if    
  s = f.ReadALL   '讀取href.txt文件
  f.Close
  sA=split(s,nl)  'href.txt文件(競賽辦法,root,1.0)以有歸位為字元或換行字元分割
  hs=""
  for i=0 to ubound(sA)  '陣列最高數
      ss= trim(sA(i)) '將字符串前后的空格去掉
      if ss <> "" then
      tb= split(ss,",") '以","分割
      if trim(tb(0)) = title then
         hs= ls&trim(tb(1))&"/entry1.asp?PNO="&trim(tb(2)) 'tb(1)指的是root
         'hs= ls&trim(tb(1))&"?PNO="&trim(tb(2))
          exit for
      end if
      end if
  next
  hs=replace(hs,"root",".") 'tb(1)root取代為.
  getHref=hs        
End function
%>

href.txt文件

活動宗旨,root,1.0
紀念衣服,root,1.1
報名網頁,news,1.0
地點位置,root,1.3
寫回網頁,root,1.2 
報名結果,root,1.5
報名人數,root,1.6
住宿資訊,root,1.7

尚未有邦友回答

立即登入回答