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

Include en ASP

Estas en el tema de Include en ASP en el foro de ASP Clásico en Foros del Web. Hola buenas, necesito hacer lo siguiente: Me gustaria saber si es posible hacer un "<!-- #INCLUDE FILE="include\createby.inc" -->" dentro de un asp para pasarle unos ...
  #1 (permalink)  
Antiguo 27/09/2007, 02:30
 
Fecha de Ingreso: agosto-2007
Mensajes: 79
Antigüedad: 17 años, 8 meses
Puntos: 0
Include en ASP

Hola buenas, necesito hacer lo siguiente:

Me gustaria saber si es posible hacer un
"<!-- #INCLUDE FILE="include\createby.inc" -->"
dentro de un asp para pasarle unos parametros.

Sino es posible hacerlo así,com puedo hacerlo para no tener que repetir codigo en cada asp???

gracias, un saludo
  #2 (permalink)  
Antiguo 27/09/2007, 06:36
Avatar de Kelpie  
Fecha de Ingreso: febrero-2002
Ubicación: NorthSpain
Mensajes: 609
Antigüedad: 23 años, 2 meses
Puntos: 8
Re: Include en ASP

No solo es posible, es MUY recomendable.
Te recuerdo de todas maneras que la línea del include debe estar fuera del código asp...

Esto va mal:

Código:
<%
  <!--#include file="talYtal.inc"-->
  ....
Esto va bien
Código:
<!--#include file="talYtal.inc"-->
<%
....

Y dentro de talYtal.inc estás en HTML. Es decir, que el código asp que tenga ese fichero debe estar entre las etiquetas <% y %>
__________________
Kelpie
  #3 (permalink)  
Antiguo 27/09/2007, 08:21
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 3 meses
Puntos: 98
Re: Include en ASP

Solamente acotar que no utilicen extensiones inc para los includes, por razones de seguridad ocupen siempre .asp

Saludos
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #4 (permalink)  
Antiguo 02/10/2007, 01:37
 
Fecha de Ingreso: agosto-2007
Mensajes: 79
Antigüedad: 17 años, 8 meses
Puntos: 0
Re: Include en ASP

Cita:
Iniciado por u_goldman Ver Mensaje
Solamente acotar que no utilicen extensiones inc para los includes, por razones de seguridad ocupen siempre .asp

Saludos
Este es el codigo original:
<table border="1" valign=down align=left bogcolor=black height="1357%" width="100%">
<tr><td ralign=left valign=top width="12%">
<!-- #INCLUDE FILE="include\title.inc" --></td>
<td align=left valign=top width="12%">
<!-- #INCLUDE FILE="include\createby.inc" --></td>
<td align=left valign=top width="12%">
<!-- #INCLUDE FILE="include\situation.inc" --></td>
<td align=left valign=top width="12%" >
<!-- #INCLUDE FILE="include\project.inc" --></td>
<td align=left valign=top width="12%" >
<!-- #INCLUDE FILE="include\producedby.inc" --></td>
</tr>
</table>
me dices que cambie a esto???:
<table border="1" valign=down align=left bogcolor=black height="1357%" width="100%">
<tr><td ralign=left valign=top width="12%">
<!-- #INCLUDE FILE="include\title.asp" --></td>
<td align=left valign=top width="12%">
<!-- #INCLUDE FILE="include\createby.asp" --></td>
<td align=left valign=top width="12%">
<!-- #INCLUDE FILE="include\situation.asp" --></td>
<td align=left valign=top width="12%" >
<!-- #INCLUDE FILE="include\project.asp" --></td>
<td align=left valign=top width="12%" >
<!-- #INCLUDE FILE="include\producedby.asp" --></td>
</tr>
</table>
  #5 (permalink)  
Antiguo 02/10/2007, 10:15
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 2 meses
Puntos: 535
Re: Include en ASP

Cita:
me dices que cambie a esto???:
Exacto, eso es lo que dice.
__________________
...___...
  #6 (permalink)  
Antiguo 03/10/2007, 03:09
 
Fecha de Ingreso: agosto-2007
Mensajes: 79
Antigüedad: 17 años, 8 meses
Puntos: 0
Re: Include en ASP

Cita:
Iniciado por Al Zuwaga Ver Mensaje
Exacto, eso es lo que dice.
hola he cambiado de .inc a .asp y nada me sigue sin funcionar no se si sera un problema de la parte esta NAME:

<tr><th align=left><%=gtxttitle%></th><th align=left><%=gtxtnumber%></th></tr>
<tr><td align=left width="16%"><textarea name=title value="" size="" ROWS=2 COLS=25></textarea></td>
<td align=left width="47%"><textarea name=number value="<%=Server.HTMLEncode(strnumber)%>" size="" ROWS=2 COLS=25></textarea></td></tr>

<tr><th align=left><%=gtxtproject%></th><th align=left><%=gtxtsituation%></th></tr>
<tr><td align=left width="16%"><textarea name=project value="<%=Server.HTMLEncode(strproject)%>" size="" ROWS=2 COLS=25></textarea></td>
<td align=left width="47%"><textarea name=situation value="<%=Server.HTMLEncode(strsituation)%>" size="" ROWS=2 COLS=25></textarea></td></tr>

<tr><th align=left><%=gtxtcreateby%></th></tr>
<tr><td align=left width="16%"><textarea name=createby value="<%=Server.HTMLEncode(strcreateby)%>" size="" ROWS=2 COLS=25></textarea></td></tr>


si llamo a cada uno por su nombre no me funciona, solo me funciona si los llamo "title" no se por que..... y este el codigo de los
.inc que para los .asp es =:

<!-- Add number here -->
<font size=2><strong>NºDE PLANO:</strong></font>&nbsp;<%=Server.HTMLEncode(strnumber)%>

<!-- Add createby here -->
<font size=2><strong>CREADO POR:</strong></font>&nbsp;<%=Server.HTMLEncode(strcreateby)%>

<!-- Add situation here -->
<font size=2><strong>SITUACION:</strong></font>&nbsp;<%=Server.HTMLEncode(strsituation)%>

<!-- Add projct here -->
<font size=2><strong>PROYECTO:</strong></font>&nbsp;<%=Server.HTMLEncode(strproject)%>

<!-- Add Title here --><font size=2><strong>TITULO:</strong</u></font>&nbsp;<%=Server.HTMLEncode(strtitle)%>
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




La zona horaria es GMT -6. Ahora son las 11:20.