May 16, 2008

Paging In Asp

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > .NET ( ASP.net VB.net )

free web hosting

Paging In Asp

darran
A wierd problem I am encountering here ... I would appreciate it if I can get any advice ASAP

I have tried to use paging in my page. It seems to be working fine when I put it with the main block of SQL codes

CODE
<%
Dim Conn        'Connection to Database
Dim RS            'RecordSet
Dim SQL            'String for SQL Statements

Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.recordset")
Conn.Open strConn
cMaxTopLevel = 8

i_pagenum = 1

SQL = "SELECT * FROM PROMO_CORNETTO_ROYALE"
RS.open SQL,Conn,3,3

i_pagenum=1
if request("page")>1 then i_pagenum=request("page")
RS.pageSize=cMaxTopLevel
for indx = 1 to RS.Pagecount
    if indx <> Cint(i_pagenum) then
        response.write "<a href=view1.asp?page=" & indx & ">" & indx & "</a>&nbsp;"                                    
    else
        current_page = indx
        Response.write "<b><font face=""Arial"" size=""2"">" & indx & "</font></b>&nbsp;"
    end if
next
if i_pagenum>1 then
    RS.AbsolutePage=i_pagenum
else
    'dont set RS.AbsolutePage
end if

%>


However when I attempt to put this with the html portion like this:

CODE
<span class="text">Page
<%
for indx = 1 to RS.Pagecount
    if indx <> Cint(i_pagenum) then
        response.write "<a href=view1.asp?page=" & indx & ">" & indx & "</a>&nbsp;"                                    
    else
        current_page = indx
        Response.write "<b><font face=""Arial"" size=""2"">" & indx & "</font></b>&nbsp;"
    end if
next
if i_pagenum>1 then
    RS.AbsolutePage=i_pagenum
else
    'dont set RS.AbsolutePage
end if

%>
</span>


The page does not refresh when I click on another one. Can anyone tell me what is the problem? It seems really wierd that putting it with the other VB code works and when I bring it to the HTML, it cease to work. I need to complete this portion in less than 4 hrs, so hopefully I get a reply ASAP.

 

 

 


Reply

jlhaslip
I don't do ASP, but open up the file in your browser and then do a View > Source to see what the html output looks like.
Might be a clue in there. Perhaps the anchor tags are not being written properly. The View > Source will tell you.

Reply

darran
There is nothing unordinary, I can't seem to picture why the different placing of codes can lead to 2 different results

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:


Searching Video's for paging, asp
advertisement



Paging In Asp



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE