พบกับบทความเกี่ยวกับคอมพิวเตอร์และ programming ได้ที่ http://articles.modoeye.com | บล็อกอาหาร
ASP programming / แสดงรูปภาพ
aln
aln
Sun 10 Sep 2006 08:42:11

ขอรบกวนช่วยดูโค้ดให้หน่อยนะครับเรื่องของการกด next และ back รูปภาพ ตอนนี้กด next และ back ได้แล้วแต่ติดตรงที่ถ้ากดไปเรื่อยๆ หากรูปภาพหมดในหมวดนี้มันจะขึ้น Error ครับ คือมันไม่ Enable ครับ

**************************************************************

<%
     if Request.Querystring("strID")="" then
  sid="1"
 else
  sid=Request.Querystring("strID") 
 end if 
 
 strAction1=sid-1 
 strAction2=sid+1
 
 artcatid = Request.QueryString("strartid")
 Set rsCate = Server.CreateObject("ADODB.RecordSet")
 Set rsCount=Server.CreateObject("ADODB.Recordset")
 sql ="Select * From TblShowArt where SID='"& sid & "' and ArtCatID='"& artcatid & "' order by SImage desc"
 rsCate.Open Sql, Connart, 0, 3
 sql1="SELECT * FROM QrCountShowArt where ArtCatID='"& artcatid & "'" 
 rsCount.Open Sql1, Connart, 0, 3
 strTotal=rsCount("CountSID")
 rsCount.Close
 
 if rsCate("SID")=strTotal then
  strEnd=true
 end if
 
 if strAction1<>0 then ' ===================================================================== Previous  
  strPrev="<a href=""view.asp?strID="&strAction1&"&strartid="&artcatid&""" title=""vorheriges Bild"">&lt; Previous</a>"
 else
  strPrev="<span class=""text5"">&lt; Previous</span>"
 end if
 
 if strEnd=true then ' =========================================================================== Next
  strNext="<span class=""text5"">Next &gt;</span>"
 else
  strNext="<a href=""view.asp?strID="&strAction2&"&strartid="&artcatid&""" title=""n&auml;chstes Bild"">Next &gt;</a>"  
 end if
 
 strHome="<a href=""view.asp?strID=1"" title=""Home"">Home</a>" ' ============================ Home
' ================================================================= End: Navigation Previous/Next/Home
 strToTImages=rsCate("SID")&" / "&strTotal

**********************************************************

กรุณาช่วยหน่อยครับ...ขอบคุณล่วงหน้าครับผม

Administrator
Sun 10 Sep 2006 11:12:12
if strEnd=true then
  strNext="<span class=""text5"">Next &gt;</span>"
 else
  strNext="<a href=""view.asp?strID="&strAction2&"&strartid="&artcatid&""" title=""n&auml;chstes Bild"">Next &gt;</a>"  
 end if

อยู่ตรงที่ Hilight ไว้นั่นล่ะครับ แต่ก็ถูกแล้วนี่ครับเมื่อรูปหมดก็ควร Disable เอาไว้ไม่อย่างนั้นอาจจะ Error ได้ครับ
Reply
Name:
E-mail:
Home | Services | Forum | Classified | Directories | Support | Contact
ATOM feed RSS 0.9 feed RSS 1.0 feed RSS 2.0 feed
Copyright © 2005 - 2007 Modoeye.com, All Rights Reserved.
Disclaimer | Privacy policy | Term of Use | Term of Services
Valid XHTML Valid CSS! PHP: Hypertext Preprocessor MySQL database Apache Powered! FreeBSD Power to serve
Modoeye Sitemap Client login