Results 1 to 2 of 2

Thread: Store data in web.config or keep using Response.WriteFile() ?

  1. #1

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Store data in web.config or keep using Response.WriteFile() ?

    I was wondering if its okay to store lots of data in the web.config page ?
    I have a load of .html template pages. Basically, I send the a html page (e.g. the header), then do some asp.net processing, then send some more html, and then maybe a footer (again, a different .html file).

    Should I store the contents in web.config because I believe that the contents of that file are cached?
    Or does data being sent by Response.WriteFile() get cached too?
    i.e. I send x.html and the system reads it into memory to send it.
    The next time I want to send x.html, is it re-read from the drive, or has it been cached?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I might've got the wrong end of the stick here, but...

    If you want to use, say a header banner throughout all the pages in your site, having the code for the banner stored in one place which is cached, you can use an include file.

    ie. you can place this code:

    <Table id="tblTestBanner" width="500px" bgcolor="red">
    <TR><TD>&nbsp;</TD></TR>
    </Table>

    in a file called MyBanner.txt in your web application's folder, then on each of your pages, you can call on the file like this to import it's text:

    <HTML>
    <HEAD></HEAD>

    <BODY>
    <!-- #include File="MyBanner.txt" -->

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width