| ||||
Re: INCLUDE DINAMICO, como se hace <% Function getFileContents(strIncludeFile) Dim objFSO Dim objText Dim strPage Set objFSO = Server.CreateObject("Scripting.FileSystemObje ct") Set objText = objFSO.OpenTextFile(Server.MapPath(strIncludeFile) ) getFileContents = objText.ReadAll objText.Close Set objText = Nothing Set objFSO = Nothing End Function %> |
| ||||
Re: INCLUDE DINAMICO, como se hace Luego debemos incluir esta porcion de codigo donde vamos a incluir nuestro archivo <% Dim strMain, strInclude If Request("id") <> "" Then strMain = getFileContents(Request("id")) else strMain = getFileContents("TUPAGINA.INC") end if If Request("id") = "" Then strInclude = getFileContents("TUPAGINA.INC") Else strInclude = getFileContents(Request("id")) End If strMain = replace(strMain,"<!-- INCLUDE FILE HERE -->",strInclude) Response.Write strMain %> |
| ||||
Re: INCLUDE DINAMICO, como se hace Como funciona? dentro de el servidor se guarda tu pagina a incluir: getFileContents("TUPAGINA.INC") y luego por medio de RESPONSE.WRITE se le envia a el cliente. Asi se evita utilizar el Include file. espero que les aproveche ![]() |
| |||
Re: INCLUDE DINAMICO, como se hace ¿Alguien me podria explicar para que sirve exactamente esto? ¿Tiene alguna mejora sobre el "modo original"? Muchas gracias y enorawena por el codigo, aunke no l ocomprenda ;) |
| ||||
Re: INCLUDE DINAMICO, como se hace amigo superjavi esto funciona cuando quieres hacer un include del tipo: #include file="<%=id%>" porque de la forma tradicional no se puede hacer <--LuBeTpIc--> |