Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Web >> Development >> ASP >> How to use a template file, perform search and replace and generate a dynamic html page

This example, the ASP code does the following - read static html page monitor_hosts_wis.htm - searches for <head> and replace with <head> some other string - writes output to html response <% response.expires=-1 Set fs = Server.CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile(Server.MapPath("monitor_hosts_wis.htm"), 1) sHtml = f.ReadAll ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' search for <head> ' replace with <head><META HTTP-EQUIV="REFRESH" CONTENT="60"> ' <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> ' <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' sReplace = "<head>" & vbCrLf & _ "<META HTTP-EQUIV=""REFRESH"" CONTENT=""60"">" & vbCrLf & _ "<META HTTP-EQUIV=""PRAGMA"" CONTENT=""NO-CACHE"">" & vbCrLf & _ "<META HTTP-EQUIV=""CACHE-CONTROL"" CONTENT=""NO-CACHE"">" & vbCrLf sHtml = Replace(sHtml,"<head>",sReplace) Response.Write(sHtml) f.Close Set f=Nothing Set fs=Nothing %>
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]