Can I use Response.WriteFile with a physical path across web servers? (ASP.NET)

Posted on 2008-11-19
Last Modified: 2013-11-18
We currently have two IIS webservers -- web and webapp.  All of our static HTML files live on web and all of our old ASPs and newer ASPX files live on webapp.

An outside consultant is redesigning our website look and feel and has given us all new HTML pages, CSS files, etc. which are all going to live on web.  We're in charge of modifying all the ASPs and ASPX files in house to get them to match the new look and feel.

For testing, we had just copied the template files over onto webapp and were  using Response.WriteFile("/ssi/header.shtml") as an example to include headers and footers in our dynamic apps which are on the webapp server...

However, we really don't want to have duplicate ssi folders on both web and webapp to maintain-- we'd like to keep all the header/footer files on just web -- problem being, if we do something like this: Response.WriteFile("http://web/ssi/header.shtml"), we get the error: 'http://web/ssi/header.shtml' is not a valid virtual path.

Is there a cleaner way to include our header and footer files across web servers?
Question by:mandi224
    1 Comment
    LVL 51

    Accepted Solution

    You can setup website paths using UNC folders.  It's a little tricky to setup.  What I do is create a Share on the server holding the files.  I then designate a domain account that only has read or write access to that folder.

    I then setup the virtual folder (or site) using the UNC path on the other host server and use the 'Connect As' feature to access the remote share.

    There are other ways by changing the identity of the application pools but that's not as simple.

    If you are simply doing reads to include the files it's a simply safe way to do it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now