Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:54:09+00:00 2026-06-05T05:54:09+00:00

I have a large html file that I want to split apart. I have

  • 0

I have a large html file that I want to split apart. I have managed to split it apart and place each part in a htm file. As a result my structure now looks like:

enter image description here

note all the files in the folder are just specific to the Default.aspx page. I like to have my code spitted into several parts; I find it easier to program that way.

Anyways why when I do:

    <%   
        Response.WriteFile("_Menu.htm");        
    %>

that creates a different output that if I where to go to _Menu.htm copying the entire content and pasting it in there? I know I can create a user control for each file. but if I do so I will have to create a page directive at the root of the page for each file and plus I just need to place static content I don’t need to call an aspx page. Why does Response.WriteFile include stuff that I don’t have in the file. For example it places ‘”‘ marks whenever I have a paragraph.

EDIT

I use user controls when I plan to reuse html. In this case I am just spliting apart a page into several ones. I will like to have the content of each chunk in a separate file.

EDIT 2

Doing:

    <%   

        //Response.WriteFile("_Menu.htm");

        Response.Write(System.IO.File.ReadAllText(@"A:\Users\Antonio\Dropbox\VisualStudio Projects\Websites\Boat\Boat\MasterPages\User\_Menu.htm"));        
    %>

works great. why is Response.WriteFile including ” (paragraph) ” at the the beginning!?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:54:10+00:00Added an answer on June 5, 2026 at 5:54 am

    create your Response.Write method:

    Create the following extension method globaly so all your pages can access it:

    using System.Web.UI;
    
    public static class StaticExtensionMethods
    {
        public static void Include(this System.Web.UI.Page Page, string path)
        {
            Page.Response.Write(System.IO.File.ReadAllText(Page.Server.MapPath(path))); 
        }
    
    
    
    }
    

    then do:

        <%   
            this.Include("_Menu.htm");
        %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large HTML file (In ASP.NET) that has several smaller ... tags
I have an MVC application view that is generating quite a large HTML table
i have a page that displays large datasets into html tables. how can i
I am parsing an html file and I want to find the part of
I have an html file that I'd like to open and read from, but
Is it possible to split the contents of file into parts that have specific
I have a large number of HTML files that I need to process with
I have this string containing a large chunk of html and am trying to
I have an HTML table with a large number of rows, and I need
I have large video files (~100GB) that are local on my machine. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.