I have an .asp page (index.asp) with a previous and next button in the footer.
<a class="btn" href="#" target="iframe"> <i class="icon-chevron-left"></i> Back </a><a class="btn" href="#" target="iframe"> Next <i class="icon-chevron-right"></i></a>
In between the header and the footer is an iframe with an id of “iframe”.
I have 35 pages that need to be displayed in sequence within the iframe starting with 01.asp
I need to be able to keep count of which page is currently being displayed, with the next button going to the next page in the sequence, but ending at the page 35.asp. The previous button cannot go back previous to 01.asp.
I tried something like this in the 01.asp file:
<% curPg=1%>
<% nxtPg = curPg + 1%>
<% prvPg = curPg - 1%>
<% prvPgURL = prvPg&".asp" %>
<% nxtPgURL = nxtPg&".asp" %>
and then added this to the button tag: <% nxtPgURL %>
<a class="btn" href="<% nxtPgURL %>" target="iframe"> Next <i class="icon-chevron-right"></i> </a>
The variables are declared in the the index.asp file
My asp is very weak, and I need help.
<%%>is simply a code block (meaning code that runs in the server side).If you want to output something, you need to use
<% Response.Write("some output here")%>, or the equivalent shortcut –<%="some output here"%>.In your last example, this would look like:
Note the
=just after the opening<%.