hi
I am just a beginner to ASP and at my work got this task to complete.There is an existing website with around 1000 asp pages.Now i have to add one table in all the pages in very short time.
Can u please help me with ideas and codes, how to do it.

Its very important for me.

Thanks


sindhu_at

Dani AI

Generated

— the fastest, safest way is to centralize the new table into one include file and then insert that include into every .asp page automatically. That builds on what , and suggested but adds concrete, repeatable steps and quick automation so you don't edit 1000 files by hand.

Create a single include (for example /includes/mytable.inc) that contains only the table HTML. Verify it on a few pages in different folders by adding the include and viewing the page. The include directive looks like this:

<!--#include virtual="/includes/mytable.inc" -->

Automation workflow (test first on a copy):

  1. Backup the site or use version control.
  2. Manually add the include to three representative pages (different directories) and confirm layout and ASP behavior.
  3. Use a bulk search-and-replace tool to insert the include before </body> (or wherever the table must go). Example Notepad++ regex find/replace:
Find: (?i)(</body>)
Replace: <!--#include virtual="/includes/mytable.inc" -->\r\n$1

Example PowerShell (run from repo root; test first):

Get-ChildItem -Recurse -Filter *.asp | ForEach-Object {
  $p = $_.FullName
  $t = Get-Content -Raw $p
  if ($t -notmatch "<!--#include.*mytable.inc") {
    $t = [regex]::Replace($t, "(?i)</body>", "<!--#include virtual='/includes/mytable.inc' -->`r`n</body>")
    Set-Content -Path $p -Value $t -Encoding UTF8
  }
}

Cautions and quick checks: use virtual when pages live in many folders (it’s root-relative); file is relative to the page. Server-side includes are resolved before ASP runs, and they must not be placed inside <% %> script blocks. Always test on a dev copy, watch for encoding/line-ending issues, and confirm in the browser by viewing page source. If editing files is impossible, the alternate (advanced) route is an IIS-level output filter or URL-rewrite module, but that adds complexity and should be a last resort.

Recommended Answers

All 3 Replies

If the existing web pages...
- are prepared using template, then modify to the template will update to all the web pages. No ASP knowledge needed, but need program like Dreamweaver or Frontpage to do this.
- use SSI to include a common file, the table may put into the common file and it will display in all web pages.

Otherwise, you may need to update them one by one. Can you put the web address here?

hi
I am just a beginner to ASP and at my work got this task to complete.There is an existing website with around 1000 asp pages.Now i have to add one table in all the pages in very short time.
Can u please help me with ideas and codes, how to do it.

Its very important for me.

Thanks


sindhu_at

To do something like that, I have a tactic that might work, if you could find the code to make a header file, you could include it in the pages and it would probably fix this up...of course placing it might be a pain but it will work.

I agree with the above and usually what I do when creating a site is make a header.asp and a footer.asp file. Then I make each individual page and place the include for the header.asp and the footer.asp within the page.

After you do this and you want to update something say in a menu at the top or a link a the bottom you only need to make the changes in one file header.asp or footer.asp and it updates in all pages that you did the include of the files in.

:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.