Foros del Web » Programando para Internet » ASP Clásico »

Menu con asp

Estas en el tema de Menu con asp en el foro de ASP Clásico en Foros del Web. Hola a todos! Encontré un programa que me arma menúes con DHTML y los deja increíbles, pero! es estático, es decir, yo le defino que ...
  #1 (permalink)  
Antiguo 22/09/2009, 08:56
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Menu con asp

Hola a todos!

Encontré un programa que me arma menúes con DHTML y los deja increíbles, pero! es estático, es decir, yo le defino que categorías van...
Ahora, tengo una estructura para hacer menús dinámicos pero en asp... cómo podría fusionarlos?? existe otra manera para que el menú en asp quede con efectos???

gracias!!!
  #2 (permalink)  
Antiguo 22/09/2009, 11:51
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Menu con asp

Hola

¿Algún clarividente?. Código, código ......
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #3 (permalink)  
Antiguo 22/09/2009, 13:40
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

es que es complejo de ver el codigo del DHTML... pero lo pondre de todas maneras...

Código:
<script type="text/javascript">
var id = '<%=strPerfil%>';
<!--
stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
stm_ai("p0i0",[0,"Sistema Documentación","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);

stm_aix("p0i1","p0i0",[0,"Archivos","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
stm_aix("p1i0","p0i1",[0,"Subir","","",0,-1,0,"Archivos.asp?strPerfil=<%=strPerfil%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
//stm_aix("p1i1","p1i0",[0,"Consultar","","",-1,-1,0,"Archivos.asp?strAccion=pdf","frm_right","","","","",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
//stm_aix("p1i2","p1i0",[0,"En formato .xls","","",-1,-1,0,"Archivos.asp?strAccion=xls","frm_right","","","","",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
stm_ep();
stm_aix("p0i2","p0i1",[0,"Diagramas","","",-1,-1,0,"Diagramas.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
stm_aix("p0i3","p0i2",[0,"Páginas","","",-1,-1,0,"Paginas.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
stm_aix("p0i4","p0i1",[0,"Diccionario","","",-1,-1,0,"#"],155,0);
stm_bpx("p2","p1",[]);
stm_aix("p2i0","p1i0",[0,"Tablas","","",0,-1,0,"Diccionario.asp?strAccion=tabla","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
stm_aix("p2i1","p2i0",[0,"Campos","","",0,-1,0,"Diccionario.asp?strAccion=campo","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
stm_aix("p2i2","p2i0",[0,"Proced. Almacenados","","",0,-1,0,"Diccionario.asp?strAccion=proced","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
stm_aix("p2i3","p2i0",[0,"Funciones","","",0,-1,0,"Diccionario.asp?strAccion=funcion","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
stm_aix("p2i4","p2i0",[0,"Vistas","","",0,-1,0,"Diccionario.asp?strAccion=vistas","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
stm_ep();
stm_aix("p0i5","p0i1",[0,"Para Descargar","","",-1,-1,0,"Descargar.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
stm_bpx("p5","p1",[]);
stm_ep();
//stm_aix("p5i0","p1i0",[0,"Diagramas","","",0,-1,0,"Descargar.asp?strAccion=diagramas","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
//stm_aix("p5i1","p1i0",[0,"Planillas","","",0,-1,0,"Descargar.asp?strAccion=planillas","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
//stm_aix("p5i2","p1i0",[0,"Manuales","","",0,-1,0,"Descargar.asp?strAccion=manuales","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);

stm_aix("p0i6","p0i0",[0,"Datos de Usuario"],155,20);
stm_aix("p0i7","p0i1",[0,"Datos Usuario","","",-1,-1,0,"DatosUsuarios.asp?strAccion=inicio&rut=<%=rut%>","frm_right","","","","",0,0,0,"","",0,0],155,0);
if (id == 1)
{

    stm_aix("p0i8","p0i0",[0,"Perfiles"],155,20);
    stm_aix("p0i9","p0i7",[0,"Adm. Perfiles","","",-1,-1,0,"Perfiles/AdmPerfil.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i10","p0i7",[0,"Adm. Usuario","","",-1,-1,0,"Mantenedor/mantenedor_usuario.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i11","p0i0",[0,"Mant. Aplicaciones"],155,20);
    stm_aix("p0i12","p0i7",[0,"Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i13","p0i7",[0,"Sub-Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmSubAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i14","p0i7",[0,"Sub-Aplicaciones n2","","",-1,-1,0,"Aplicaciones/AdmSSAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_ep();
}
stm_sc(1,["transparent","transparent","","",3,3,0,0,"#FFFFF7","#000000","up_disabled.gif","up_enabled.gif",7,9,0,"down_disabled.gif","down_enabled.gif",7,9,0,0,1]);
stm_em();
//-->
</script>
ven?
este menú está de pelos, pero necesito hacerlo dinámico, que el menu se arme de acuerdo a la base de datos... de lo contrario, lo armo, pero con simple html...
esop...

Última edición por pali_wichis; 22/09/2009 a las 13:42 Razón: me falto la descripción...
  #4 (permalink)  
Antiguo 22/09/2009, 14:36
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Menu con asp

Hola

Si que es farragoso. Se me ocurre que podrías sacar los registros con getrows() y después ir insertandolos. Por ejemplo

stm_aix("p0i8","p0i0",[0,"<%=registro(0,5)%>"],155,20);

que correspondería por ejemplo a Perfiles

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #5 (permalink)  
Antiguo 22/09/2009, 14:57
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

si, se me ocurrió lo mismo, pero no me muestra el menu... creo que porque va entre la etiqueta de <script>...

no se seguire buscando... gracias...
  #6 (permalink)  
Antiguo 22/09/2009, 15:19
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Menu con asp

Hola

Si no funciona, no es por la razón que dices. Puedes insertar ASP en javascript

Suerte

EDITO

De hecho lo estas haciendo

var id = '<%=strPerfil%>';
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #7 (permalink)  
Antiguo 23/09/2009, 08:24
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

si... puede ser como tu dices... ahora, yo puedo hacer un response.write seguido de las etiquetas javascript???
porque lo que yo hago por ejemplo es hacer esto:
Código:
FOR Each ObjSegment in objXML.selectNodes("cmd_storeproc/output/rootxml/spxml/row")
  
        Contenido = Contenido & "<tr>"
        if p <> ObjSegment.selectSingleNode("@indice").text then
        Contenido = Contenido & "<td width=50% class=reqdatos3><input type=hidden name=indice value="&ObjSegment.selectSingleNode("@indice").text&">" & ObjSegment.selectSingleNode("@indice").text & "</a></td>"
         else
        Contenido = Contenido & "<td width=50% class=reqdatos3 align=center>" & "</td>"   
         end if
        Contenido = Contenido & "<td  width=20% class=reqdatos3 align=left><input type=hidden name=nombrecampo value="&ObjSegment.selectSingleNode("@campo").text&">" & ObjSegment.selectSingleNode("@campo").text & "</td>"
        'if duplicados <> ObjSegment.selectSingleNode("@dup").text then
        Contenido = Contenido & "<td width=10% class=reqdatos3   align=left><input type=hidden name=duplicados value="&ObjSegment.selectSingleNode("@dup").text&">" & ObjSegment.selectSingleNode("@dup").text & "</td>"
        'else
        'Contenido = Contenido & "<td width=10% class=reqdatos3 align=center>" & "</td>"  
        ' end if
        Contenido = Contenido & "</tr>" 
     
        
        p = ObjSegment.selectSingleNode("@indice").text
        duplicados = ObjSegment.selectSingleNode("@dup").text
  NEXT
y luego en el body....
Código:
<%response.write contenido%>
se podrá hacer lo mismo pero en vez de html con el dhtml o javascript???

gracias!
  #8 (permalink)  
Antiguo 23/09/2009, 12:49
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 23 años, 4 meses
Puntos: 16
Respuesta: Menu con asp

bueno, el programa que dices es el de sothink dhtml, ese lo que hace es hacer un consecutivo de las opciones del menu, si te fijas al inicio de las lineas ponen un numero que va aumentando, ademas de otras cosas, por ejemplo:
Código html:
Ver original
  1. stm_aix("[B]p2i0[/B]","p1i0",[0,"Tablas","","",0,-1,0,"Diccionario.asp?strAccion=tabla","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
  2. stm_aix("[B]p2i1[/B]","p2i0",[0,"Campos","","",0,-1,0,"Diccionario.asp?strAccion=campo","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
  #9 (permalink)  
Antiguo 23/09/2009, 13:19
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

si, lo se, de hecho, los menus los he hecho con ese programa...
el problema es que quiero combinar el asp con ese código para que se vaya armando de manera dinámica, esto es, si se agrega un nivel de menu o si se quita mediante un mantenedor dentro de la misma aplicación...
  #10 (permalink)  
Antiguo 24/09/2009, 08:35
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 23 años, 4 meses
Puntos: 16
Respuesta: Menu con asp

habria que estudiar el por que y el para que de esta parte:
"p2i0","p1i0"

supongo que el primer numero es el consecutivo raiz y el segundo por si hay submenus, habria que checar bien como manejar esa parte supongo
  #11 (permalink)  
Antiguo 24/09/2009, 10:23
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

uuuu a que no lo creen...
bueno, lo estoy haciendo funcionar... aunque es rejodido... en realidad lo que estoy probando ahora (y que al menos me armo el menu) es meter el asp en el trozo de javascript... de este modo...
Código:
<script type="text/javascript">
var id = '<%=strPerfil%>';
<!--
stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
<%do while not objRec.EOF and objRec.BOF = false%>
stm_ai("p0i0",[0,"<%=objRec.fields("aplicacion")%>","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);

stm_aix("p0i1","p0i0",[0,"<%=objRec.fields("nombresub")%>","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
<%'if (Trim(objRec.fields("subapp"))= "SI") then 
    'do while not objRec1.EOF%>
stm_aix("p1i0","p0i1",[0,"<%'=objRec1.fields("sub2aplicacion")%>","","",0,-1,0,"Archivos.asp?strPerfil=<%=strPerfil%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
//stm_aix("p1i1","p1i0",[0,"Consultar","","",-1,-1,0,"Archivos.asp?strAccion=pdf","frm_right","","","","",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
//stm_aix("p1i2","p1i0",[0,"En formato .xls","","",-1,-1,0,"Archivos.asp?strAccion=xls","frm_right","","","","",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],150,0);
stm_ep();
    <%'objRec1.MoveNext
       ' loop
        '    set objRec1 = nothing
  
  'end if
  objRec.MoveNext
    loop
        set objRec = nothing%>
al menos dio resultado, lo malo, son los submenús que no me los muestra porque no me deja incluir un ciclo while dentro de otro, lo que estoy haciendo es probar con recordsets y cuando funcione bien, reemplazarlo por xml...

eso... a penas lo tenga se los dejo como ejemplo...
:D
  #12 (permalink)  
Antiguo 24/09/2009, 12:29
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Menu con asp

Hola

No entiendo como dices que te funciona con el ciclo y usando el vector que genera getrows no. Ya que dices que no te permite insertar un ciclo dentro de otro getrows es una muy buena elección, por varios factores además del que te ocupa

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #13 (permalink)  
Antiguo 24/09/2009, 12:41
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

Hola Adler... no entiendo bien lo que quisiste decir...
lo que pasa es esto: tengo (por ahora) dos recordsets, uno lleno con menus y el segundo con submenus. Como no todos los menus tienes submenus, lo que hago es lo siguiente:

Código:
<script type="text/javascript">
var id = '<%=strPerfil%>';
<!--
stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
stm_ai("p0i0",[0,"Sistema Documentación","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);
<%do while not objRec.EOF and objRec.BOF = false
    if (Trim(objRec.fields("subapp"))= "SI") then 
       do while not objRec1.EOF and objRec1.BOF = false%>  ES EN ESTA FILA DONDE ME DA EL ERROR: Se requiere un objeto
/doc_sarina/newmenu.asp, línea 200

            stm_aix("p0i1","p0i0",[0,"<%=objRec1.fields("subaaplicacion")%>","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
            stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
            stm_aix("p1i0","p0i1",[0,"<%=objRec1.fields("sub2aplicacion")%>","","",0,-1,0,"<%=objRec1.fields("sspaginainicio")%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
<%      objRec1.MoveNext
          loop
             set objRec1 = nothing

else%>
stm_aix("p0i1","p0i0",[0,"<%=objRec.fields("nombresub")%>","","",-1,-1,0,"<%=objRec.fields("paginainicio")%>","frm_right","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);  <%end if%>
stm_ep();
    <%objRec.MoveNext
        loop
            set objRec = nothing%>
Por eso la pregunta...
  #14 (permalink)  
Antiguo 24/09/2009, 15:13
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Menu con asp

Hola

Yo me refiero a esto

Código asp:
Ver original
  1. rec1 = objRec.getrows()
  2. rec2 = objRec1.getrows()
  3.  
  4. stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
  5. stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
  6. stm_ai("p0i0",[0,"Sistema Documentación","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);
  7. <%For i = 0 to UBound(rec1,2)
  8.     if (Trim(rec1(subapp,i))= "SI") then
  9.        For j = 0 to UBound(rec2,2)%>  ES EN ESTA FILA DONDE ME DA EL ERROR: Se requiere un objeto
  10. /doc_sarina/newmenu.asp, línea 200
  11.  
  12.             stm_aix("p0i1","p0i0",[0,"<%=rec2(subaaplicacion,j)%>","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
  13.             stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
  14.             stm_aix("p1i0","p0i1",[0,"<%=rec2(sub2aplicacion,j)%>","","",0,-1,0,"<%=rec2(sspaginainicio,j)%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#666666"],155,0);
  15. <%     next 'j
  16.  
  17. else%>
  18. stm_aix("p0i1","p0i0",[0,"<%=re1(nombresub,i)%>","","",-1,-1,0,"<%=rec1(paginainicio,i)%>","frm_right","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);  <%end if%>
  19. stm_ep();
  20.     <%
  21. end if
  22. next 'i%>

.... tal vez estoy equivocado, ya que no logro hacerme una idea global del asunto

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #15 (permalink)  
Antiguo 29/09/2009, 15:36
 
Fecha de Ingreso: febrero-2004
Ubicación: santiago
Mensajes: 24
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: Menu con asp

Acá esta echo yo lo hice hace un par de años y aun los ocupo sirve para menús con 2 sub categorías y la principal

Código:
<script type="text/javascript" language="JavaScript1.2" src="stmenu.js"></script>

<script type="text/javascript" language="JavaScript1.2">
<!--
stm_bm(["menu3a7f",640,"","blank.gif",0,"","",0,0,250,0,1000,1,0,0,"","",0,0,1,2,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,3,15,7,100,"",-2,"",-2,50,0,0,"#999999","#FFFFF7","",3,0,0,"#000000"]);
stm_ai("p0i0",[0,"Home","","",-1,-1,0,"default.asp","_self","","","menu_0.gif","menu_1.gif",15,8,0,"","",0,0,0,0,1,"<%= menu %>",0,"<%= menu1 %>",0,"","",3,3,0,0,"#FFFFF7","#000000","#333333","#FFFFFF","11px 'Arial','Verdana'","11px 'Arial','Verdana'",0,0],160,22);

<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open MM_conn_STRING
Set Rs = Server.CreateObject("ADODB.RecordSet")
Call_SP = "SELECT CAT.ca_nombre, CAT.ca_id, CAT.ca_modo, IsNull((SELECT Count(*) FROM CATEGORIAS WHERE ca_parent = CAT.ca_id),0) as tsub FROM CATEGORIAS AS CAT WHERE CAT.ca_parent = 0 and CAT.ca_subcat = 0 AND ( CAT.ca_modo = 0 OR CAT.ca_modo = 2) and CAT.ca_tipo = 0 and CAT.ca_sitio = "&SITIO&" ORDER BY CAT.ca_modo desc, CAT.ca_orden"
Rs.Open Call_SP, oConn, 1
While Not Rs.Eof
If Rs("tsub") > 0  Then %>


stm_aix("p0i1","p0i0",[0,"<%= Rs("ca_nombre") %>","","",-1,-1,0,"","_self","","","menu_0.gif","menu_1.gif",15,8,0,"","",7,7],160,22);
stm_bpx("p1","p0",[1,2,3]);

<%
Set Rs2 = Server.CreateObject("ADODB.RecordSet")
Call_SP = "SELECT CAT.ca_nombre, CAT.ca_id, CAT.ca_modo, IsNull((SELECT Count(*) FROM CATEGORIAS   WHERE ca_subcat = CAT.ca_id),0) as tsub2 FROM CATEGORIAS AS CAT WHERE CAT.ca_parent = "& Rs("ca_id") &" ORDER BY CAT.ca_orden"
'response.Write(Call_SP)
Rs2.Open Call_SP, oConn, 1
While Not Rs2.Eof
%>
stm_aix("p1i2","p0i1",[0,"<%= Rs2("ca_nombre") %>","","",-1,-1,0,"<% If rs2("tsub2") = 0  Then %>informacion.asp?idq=<%= Rs2("ca_id") %><% End If %>"],170,22);
<%
		If Rs2("tsub2") > 0  Then %>
stm_bpx("p2","p0",[1,2,2,0,1,3,15,0]);
<%
		Set Rs3 = Server.CreateObject("ADODB.RecordSet")
		Call_SP = "SELECT * FROM CATEGORIAS WHERE ca_subcat = "& Rs2("ca_id") &" order by ca_orden"
		'response.Write(Call_SP)
		Rs3.Open Call_SP, oConn, 1
		While Not Rs3.Eof
		%>

stm_aix("p2i0","p0i0",[0,"<%= Rs3("ca_nombre") %>","","",-1,-1,0,"informacion.asp?idq=<%= Rs3("ca_id") %>"],160,22);
<%
		Rs3.MoveNext()
		Wend
		Rs3.Close
		Set Rs3 = Nothing %>
stm_ep();//cierra rs3
<%
End If
Rs2.MoveNext()
Wend
Rs2.Close
Set Rs2 = Nothing %>
stm_ep();//cierra rs2
<%
Else %>
stm_aix("p0i2","p0i0",[0,"<%= Rs("ca_nombre") %>","","",-1,-1,0,"informacion.asp?idq=<%= Rs("ca_id") %>"],160,22);
<%
End If
Rs.MoveNext()
Wend
Rs.Close
Set Rs = Nothing
oConn.Close
Set oConn = Nothing
%>
stm_aix("p0i2","p0i0",[0,"<%= NNoticias %>","","",-1,-1,0,"noticias_listado.asp"],160,22);
stm_ep();//cierra rs1
stm_em();
//-->
</script>
  #16 (permalink)  
Antiguo 30/09/2009, 09:04
 
Fecha de Ingreso: febrero-2008
Mensajes: 111
Antigüedad: 17 años, 1 mes
Puntos: 1
Respuesta: Menu con asp

Hola!
muy buena tu acotación...
yo tb lo hice... pero con xml para que sea mas rápido y liviano:

Código:
<script type="text/javascript">
var id = '<%=strPerfil%>';
<!--

stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
stm_ai("p0i0",[0,"Sistema Documentación","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);

<%dim objCom
  dim objXSL
  dim objXML,objXML1
  dim strXML,strXML1
  dim ObjSegment,ObjSegment1  
 

  set objCom = server.CreateObject("DocSarina.clsDocumentacion")
  set objXML = Server.CreateObject("MSXML2.DOMDocument")
  set objXML1 = Server.CreateObject("MSXML2.DOMDocument")

  strXML = objCom.ArmaMenu()
  objXML.loadXML(strXML) 

  strXML1 = objCom.ArmaSubMenu()
  objXML1.loadXML(strXML1) 

  dim nombreapp,nombresubapp
  '........................................................
  'response.Write("objXML1:" & objXML1.xml & "<br>")
  'response.End 
  '........................................................
  
FOR Each ObjSegment in objXML.selectNodes("cmd_storeproc/output/rootxml/spxml/row")
    nombreapp = ObjSegment.selectSingleNode("@nombresub").text
    'response.Write "nombreapp:" & nombreapp & "<br>"
    
      if (Trim(ObjSegment.selectSingleNode("@subapp").text)= "SI") then %>
        
       stm_aix("p0i1","p0i0",[0,"<%=ObjSegment.selectSingleNode("@nombresub").text%>","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);  
       stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
     
       stm_bpx("p2","p1",[]);
      <%FOR Each ObjSegment1 in objXML1.selectNodes("cmd_storeproc/output/rootxml/spxml/row")%>
        
            <% nombresubapp = ObjSegment1.selectSingleNode("@subaplicacion").text
                if (Trim(nombreapp) = Trim(nombresubapp)) then%> 
                   
                    stm_aix("p2i0","p1i0",[0,"<%=ObjSegment1.selectSingleNode("@sub2aplicacion").text%>","","",0,-1,0,"<%=ObjSegment1.selectSingleNode("@sspaginainicio").text & "?"& "strPerfil="& strPerfil & "&" &"strAccion=" & ObjSegment1.selectSingleNode("@sub2aplicacion").text%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
                 
        <%      end if
      
       'nombresubapp = ObjSegment1.selectSingleNode("@subaplicacion").text
       NEXT
       %>
         
        stm_ep(); 
     <% else%>
            stm_aix("p0i1","p0i0",[0,"<%=ObjSegment.selectSingleNode("@nombresub").text%>","","",-1,-1,0,"<%=ObjSegment.selectSingleNode("@paginainicio").text%>","frm_right","","","","",0,0,0,"","",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
            stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
            stm_ep();
            
           
    <%end if 
    
    NEXT
 
   set objCom = nothing
   set objXML = nothing
   set objXSL = nothing %>
           
        
 stm_aix("p0i6","p0i0",[0,"Datos de Usuario"],155,20); 
 stm_aix("p0i7","p0i1",[0,"DatosUsuario","","",-1,-1,0,"DatosUsuarios.asp?strAccion=inicio&rut=<%=rut%>","frm_right","","","","",0,0,0,"","",0,0],155,0);
if (id == 1)
{

    stm_aix("p0i8","p0i0",[0,"Perfiles"],155,20);
    stm_aix("p0i9","p0i7",[0,"Adm. Perfiles","","",-1,-1,0,"Perfiles/AdmPerfil.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i10","p0i7",[0,"Adm. Usuario","","",-1,-1,0,"Mantenedor/mantenedor_usuario.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i11","p0i0",[0,"Mant. Aplicaciones"],155,20);
    stm_aix("p0i12","p0i7",[0,"Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i13","p0i7",[0,"Sub-Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmSubAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i14","p0i7",[0,"Sub-Aplicaciones n2","","",-1,-1,0,"Aplicaciones/AdmSSAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_ep();
}
stm_sc(1,["transparent","transparent","","",3,3,0,0,"#FFFFF7","#000000","up_disabled.gif","up_enabled.gif",7,9,0,"down_disabled.gif","down_enabled.gif",7,9,0,0,1]);
stm_em();
//-->
</script>
espero que les sirva y los ayude en la creación de menus mas vistosos... el modelo esta en 3 capas, por lo que si quieren saber como modele la componente y los sp solo escribanme aca y se los envio por correo :D
saludos!!!!
  #17 (permalink)  
Antiguo 14/12/2009, 20:44
 
Fecha de Ingreso: febrero-2009
Mensajes: 11
Antigüedad: 16 años, 2 meses
Puntos: 0
Respuesta: Menu con asp

Cita:
Iniciado por pali_wichis Ver Mensaje
Hola!
muy buena tu acotación...
yo tb lo hice... pero con xml para que sea mas rápido y liviano:

Código:
<script type="text/javascript">
var id = '<%=strPerfil%>';
<!--

stm_bm(["menu0a7f",820,"","blank.gif",0,"","",0,0,250,50,1000,1,0,0,"","",0,0,1,1,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,13,16,100,"progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F","#F2F2F2","",3,0,0,"#666666"]);
stm_ai("p0i0",[0,"Sistema Documentación","","",-1,-1,0,"","_self","","","","",13,0,0,"","",0,0,0,0,1,"#8AAEC6",0,"#8AAEC6",0,"","",3,3,0,0,"#FFFFFF","#FFFFFF","#003366","#003366","bold 8pt Arial","bold 8pt Arial",0,0],155,20);

<%dim objCom
  dim objXSL
  dim objXML,objXML1
  dim strXML,strXML1
  dim ObjSegment,ObjSegment1  
 

  set objCom = server.CreateObject("DocSarina.clsDocumentacion")
  set objXML = Server.CreateObject("MSXML2.DOMDocument")
  set objXML1 = Server.CreateObject("MSXML2.DOMDocument")

  strXML = objCom.ArmaMenu()
  objXML.loadXML(strXML) 

  strXML1 = objCom.ArmaSubMenu()
  objXML1.loadXML(strXML1) 

  dim nombreapp,nombresubapp
  '........................................................
  'response.Write("objXML1:" & objXML1.xml & "<br>")
  'response.End 
  '........................................................
  
FOR Each ObjSegment in objXML.selectNodes("cmd_storeproc/output/rootxml/spxml/row")
    nombreapp = ObjSegment.selectSingleNode("@nombresub").text
    'response.Write "nombreapp:" & nombreapp & "<br>"
    
      if (Trim(ObjSegment.selectSingleNode("@subapp").text)= "SI") then %>
        
       stm_aix("p0i1","p0i0",[0,"<%=ObjSegment.selectSingleNode("@nombresub").text%>","","",-1,-1,0,"","_self","","","","",0,0,0,"fadearrow1.gif","fadearrow2.gif",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"fade.gif","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);  
       stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
     
       stm_bpx("p2","p1",[]);
      <%FOR Each ObjSegment1 in objXML1.selectNodes("cmd_storeproc/output/rootxml/spxml/row")%>
        
            <% nombresubapp = ObjSegment1.selectSingleNode("@subaplicacion").text
                if (Trim(nombreapp) = Trim(nombresubapp)) then%> 
                   
                    stm_aix("p2i0","p1i0",[0,"<%=ObjSegment1.selectSingleNode("@sub2aplicacion").text%>","","",0,-1,0,"<%=ObjSegment1.selectSingleNode("@sspaginainicio").text & "?"& "strPerfil="& strPerfil & "&" &"strAccion=" & ObjSegment1.selectSingleNode("@sub2aplicacion").text%>","frm_right","","","","fadearrow2.gif",16,9,0,"","",0,0,0,0,1,"#B3D3E8",0,"#0000FF",1,"","fade.gif",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
                 
        <%      end if
      
       'nombresubapp = ObjSegment1.selectSingleNode("@subaplicacion").text
       NEXT
       %>
         
        stm_ep(); 
     <% else%>
            stm_aix("p0i1","p0i0",[0,"<%=ObjSegment.selectSingleNode("@nombresub").text%>","","",-1,-1,0,"<%=ObjSegment.selectSingleNode("@paginainicio").text%>","frm_right","","","","",0,0,0,"","",16,9,0,0,0,"#FFFFFF",1,"#B7CEE2",0,"","",3,3,0,0,"#CCCCCC","#FFFFFF","#999999","#000000","8pt Arial","8pt Arial"],155,0);
            stm_bp("p1",[1,4,0,0,1,1,16,0,100,"stEffect(\"slip\")",-2,"",-2,85,1,3,"#7F7F7F","transparent","",3,1,1,"#999999","",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"",-1,-1,0,"#FFFFF7","",3,"","","","",0,0,0,0,0,0,0,0]);
            stm_ep();
            
           
    <%end if 
    
    NEXT
 
   set objCom = nothing
   set objXML = nothing
   set objXSL = nothing %>
           
        
 stm_aix("p0i6","p0i0",[0,"Datos de Usuario"],155,20); 
 stm_aix("p0i7","p0i1",[0,"DatosUsuario","","",-1,-1,0,"DatosUsuarios.asp?strAccion=inicio&rut=<%=rut%>","frm_right","","","","",0,0,0,"","",0,0],155,0);
if (id == 1)
{

    stm_aix("p0i8","p0i0",[0,"Perfiles"],155,20);
    stm_aix("p0i9","p0i7",[0,"Adm. Perfiles","","",-1,-1,0,"Perfiles/AdmPerfil.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i10","p0i7",[0,"Adm. Usuario","","",-1,-1,0,"Mantenedor/mantenedor_usuario.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i11","p0i0",[0,"Mant. Aplicaciones"],155,20);
    stm_aix("p0i12","p0i7",[0,"Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i13","p0i7",[0,"Sub-Aplicaciones","","",-1,-1,0,"Aplicaciones/AdmSubAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_aix("p0i14","p0i7",[0,"Sub-Aplicaciones n2","","",-1,-1,0,"Aplicaciones/AdmSSAplicacion.asp","frm_right","","","","",0,0,0,"","",0,0],155,0);
    stm_ep();
}
stm_sc(1,["transparent","transparent","","",3,3,0,0,"#FFFFF7","#000000","up_disabled.gif","up_enabled.gif",7,9,0,"down_disabled.gif","down_enabled.gif",7,9,0,0,1]);
stm_em();
//-->
</script>
espero que les sirva y los ayude en la creación de menus mas vistosos... el modelo esta en 3 capas, por lo que si quieren saber como modele la componente y los sp solo escribanme aca y se los envio por correo :D
saludos!!!!
A mi me interesa mucho tu menu, es posible que me lo envies a mi correo, te lo agradeceria un monton.
[email protected]


gracias...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 23:47.