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

  • Home
  • SEARCH
  • 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 7876715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:12:39+00:00 2026-06-03T03:12:39+00:00

NOT Web Pages Application – I used VisualStudio 2010 and it is a multi-projects

  • 0

NOT Web Pages Application – I used VisualStudio 2010 and it is a multi-projects solution.

Now the Web Application is in .Net 4.0 but with over 200+ aspx files in it, today I was just trying to add a few Razor references and see whether it could work – surprisingly it gave me a feeling that it might be possible?

here’s the web.config file I made, however it gave me “This type of page is not served.” error. can anyone give me a hand to see if it is possible?

here’s my modified web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
  </connectionStrings>
  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>
  <system.web.webPages.razor>
    <host factoryType="System.Web.WebPages.Razor.WebRazorHostFactory, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.WebPages.WebPage">
      <namespaces>
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Web.WebPages.Html" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>
  <system.web>
    <httpRuntime requestValidationMode="2.0" maxRequestLength="1048576000" executionTimeout="99999" />
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <pages validateRequest="false">
      <namespaces>
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Web.WebPages.Html" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
    <httpHandlers>
      <add path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="PBHttpModule" type="WebCider.PortalBuilder.Framework.Web.Http.PBHttpModule, WebCider.PortalBuilder.Framework.Web" />
    </modules>
    <directoryBrowse enabled="true" />
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1048576000" />
        <fileExtensions>
          <add fileExtension=".cshtml" allowed="true" />
        </fileExtensions>
      </requestFiltering>
    </security>
    <handlers>
    </handlers>
  </system.webServer>
  <runtime>
  </runtime>
</configuration>
  • 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-03T03:12:39+00:00Added an answer on June 3, 2026 at 3:12 am

    You don’t really need to modify anything in your current web forms application. You could simply start by adding a ~/Foo.cshtml Razor file to the root with the following contents for example:

    @DateTime.Now
    

    and then simply navigate to http://example.com/Foo.cshtml. The <system.web.webPages.razor> sections that you have added to your web.config are useless in a WebForms application because you don’t have controllers that return view results that render a System.Web.WebPages.WebPage instance. Obviously due to the this fact you cannot use HTML helpers inside those Razor templates. It’s just simple Razor as you get in WebMatrix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The AD FS 2.0 sign-in pages are a small ASP.NET web application (using .NET
I have an .Net Froms application that displays web pages through a WebBrowser control.
I am used to making web pages with animation using JQuery. I am now
In Visual Studio website projects (in Visual Studio 2005 or later, not web application
I'm trying to test Scrapy for crawling web pages and I do not understand
I visited Avis.com, and I notice the web pages have *.ac extension. Not familiar
I have an ASP.NET web page(Not MVC ) (HomePage.aspx) and another page (PRiceList.aspx).I have
I want to print a web page using JavaScript. But I do not want
We have an application that takes snapshots of certain web pages. It's quite tightly
I'd like to create a web application using Spring and .jspx web pages. My

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.