Change your onclick to say prevLocation(1) and nextLocation(1). Then you will need to update the "1" every time you change pages.
Then, in your Javascript
:
Code:
function prevLocation(ind) {
document.write(location.pathname);
window.location="pg_000" + (ind-1) + ".asp";
}
function nextLocation(ind) {
document.write(location.pathname);
window.location="pg_000" + (ind+1) + ".asp";
}
If you wanted to do this with ASP instead, just change your JS functions to be ASP:
Code:
<%
thisPage = mid(Request.ServerVariables("SCRIPT_NAME"),InStr(Request.ServerVariables("SCRIPT_NAME"),"pg_")+3,4)
' the above code will set variable thisPage = numeric name of the page. You may need to change this slightly based on testing.
'
thisPage = cInt(thisPage) 'ensures this is an integer
'
'
response.write("<a href=""#"" onclick=""pg_" & thisPage-1 & ".asp"">Previous Page</a>")
response.write("<a href=""#"" onclick=""pg_" & thisPage+1 & ".asp"">Next Page</a>")
%>