Así al casi que el vuelo te he montado esto. Fíjate especialmente en lo que está en negrita
Cita:
Suerte <%
if Request.QueryString("IrA") = "" then
pagina = 1
pag2 = 1
pag3 = 1
cual = "1-1"
pagYancla = Split(cual, "-")
else
cual = Request.Querystring("irA")
pagYancla = Split(cual, "-")
Select Case pagYancla(1)
Case 1
pagina = CInt(pagYancla(0))
pag2 = 1
pag3 = 1
Case 2
pagina = 1
pag2 = CInt(pagYancla(0))
pag3 = 1
Case 3
pagina = 1
pag2 = 1
pag3 = CInt(pagYancla(0))
Case Else
pagina = 1
pag2 = 1
pag3 = 1
End Select
end if
%>
<html>
<head>
<style type="text/css">
.ocultar {display:none;}
.mostrar {display:block;}
.sel {color:#FF0000;}
.nosel {color:#000000;}
</style>
<script type="text/javascript">
var visto_subm = null;
var visto_color = null;
function ver(val) {
objhl = document.getElementById(val);
obj = document.getElementById(val + '_menu');
obj.className = (obj==visto_subm) ? 'ocultar' : 'mostar';
objhl.className = (objhl==visto_color) ? 'nosel' : 'sel';
if ((visto_subm != null) && (visto_color != null)) {
visto_subm.className = 'ocultar';
visto_color.className = 'nosel';
}
visto_subm = (obj==visto_subm) ? null : obj;
visto_color = (obj==visto_color) ? null : objhl;
}
window.onload = function() {ver('p<%=pagYancla(1)%>');};
</script>
</head>
<body>
<%
set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("./database.mdb")&";"
%>
<div id="contenedor">
<ul>
<li id="p1" onclick="ver(this.id);" class="nosel">PAG 1</li>
<li id="p2" onclick="ver(this.id);" class="nosel">PAG 2</li>
<li id="p3" onclick="ver(this.id);" class="nosel">PAG 3</li>
</ul>
<div id="p1_menu" class="ocultar">
<div>PAG 1<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pagina
WHILE NOT prodRS.EOF AND rowCount1 < prodRS.PageSize
rowCount1 = rowCount + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pagina) THEN
%>
<a href="index.asp?irA=<%=i%>-1"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
<div id="p2_menu" class="ocultar">
<div>PAG 2<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pag2
WHILE NOT prodRS.EOF AND rowCount2 < prodRS.PageSize
rowCount2 = rowCount2 + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pag2) THEN
%>
<a href="index.asp?irA=<%=i%>-2"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
<div id="p3_menu" class="ocultar">
<div>PAG 3<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pag3
WHILE NOT prodRS.EOF AND rowCount3 < prodRS.PageSize
rowCount3 = rowCount3 + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pag3) THEN
%>
<a href="index.asp?irA=<%=i%>-3"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
</div>
</body>
</html>
if Request.QueryString("IrA") = "" then
pagina = 1
pag2 = 1
pag3 = 1
cual = "1-1"
pagYancla = Split(cual, "-")
else
cual = Request.Querystring("irA")
pagYancla = Split(cual, "-")
Select Case pagYancla(1)
Case 1
pagina = CInt(pagYancla(0))
pag2 = 1
pag3 = 1
Case 2
pagina = 1
pag2 = CInt(pagYancla(0))
pag3 = 1
Case 3
pagina = 1
pag2 = 1
pag3 = CInt(pagYancla(0))
Case Else
pagina = 1
pag2 = 1
pag3 = 1
End Select
end if
%>
<html>
<head>
<style type="text/css">
.ocultar {display:none;}
.mostrar {display:block;}
.sel {color:#FF0000;}
.nosel {color:#000000;}
</style>
<script type="text/javascript">
var visto_subm = null;
var visto_color = null;
function ver(val) {
objhl = document.getElementById(val);
obj = document.getElementById(val + '_menu');
obj.className = (obj==visto_subm) ? 'ocultar' : 'mostar';
objhl.className = (objhl==visto_color) ? 'nosel' : 'sel';
if ((visto_subm != null) && (visto_color != null)) {
visto_subm.className = 'ocultar';
visto_color.className = 'nosel';
}
visto_subm = (obj==visto_subm) ? null : obj;
visto_color = (obj==visto_color) ? null : objhl;
}
window.onload = function() {ver('p<%=pagYancla(1)%>');};
</script>
</head>
<body>
<%
set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("./database.mdb")&";"
%>
<div id="contenedor">
<ul>
<li id="p1" onclick="ver(this.id);" class="nosel">PAG 1</li>
<li id="p2" onclick="ver(this.id);" class="nosel">PAG 2</li>
<li id="p3" onclick="ver(this.id);" class="nosel">PAG 3</li>
</ul>
<div id="p1_menu" class="ocultar">
<div>PAG 1<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pagina
WHILE NOT prodRS.EOF AND rowCount1 < prodRS.PageSize
rowCount1 = rowCount + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pagina) THEN
%>
<a href="index.asp?irA=<%=i%>-1"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
<div id="p2_menu" class="ocultar">
<div>PAG 2<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pag2
WHILE NOT prodRS.EOF AND rowCount2 < prodRS.PageSize
rowCount2 = rowCount2 + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pag2) THEN
%>
<a href="index.asp?irA=<%=i%>-2"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
<div id="p3_menu" class="ocultar">
<div>PAG 3<br />
<%
Set prodRS = Server.CreateObject( "ADODB.Recordset" )
prodRS.PageSize = 1
sql = "SELECT nombre, telefono FROM tabla WHERE nombre = 'Adler'"
prodRS.Open SQL, oConn,3,1
if prodRS.eof and prodRS.bof then
response.write "Actualmente no hay inmuebles"
else
prodRS.AbsolutePage =pag3
WHILE NOT prodRS.EOF AND rowCount3 < prodRS.PageSize
rowCount3 = rowCount3 + 1
Response.Write prodRS.Fields("nombre") & " - " & prodRS.Fields("telefono")
prodRS.MoveNext
WEND
%>
</div>
<div>
<%
FOR i = 1 to prodRS.PageCount
IF i <> CInt(pag3) THEN
%>
<a href="index.asp?irA=<%=i%>-3"><%=i%></a>
<% ELSE %>
<b><%=i%></b>
<%
END IF
NEXT
%>
</div>
<%
end if
prodRS.close
Set prodRS=nothing
%>
</div>
</div>
</body>
</html>