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 7513165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:05:24+00:00 2026-05-30T00:05:24+00:00

I am trying to create a website using some of the Razor functionality, but

  • 0

I am trying to create a website using some of the Razor functionality, but without using Visual Studio. The main reason for this is that I’m currently mainly working from a Mac, and I’d like to use Coda for editing the pages.

I don’t need a programmable website, in the sense of database access, that sort of thing, but I’d like to use RenderPartial so that I can split up the pages and implement some common functionality, like menus and so on.

So, I tried the following:

  1. I created a new site under IIS7
  2. I dropped in a .cshtml file with this code: @DateTime.Now
  3. I opened it through Chrome

This displayed the current date and time, so clearly the razor engine executes.

Then I tried the following code:

@Html.RenderPartial("menu.cshtml")

and I get this error message:

c:\inetpub\drip\dev2\index.cshtml(1,12): error CS1061: ‘System.Web.WebPages.Html.HtmlHelper’ does not contain a definition for ‘RenderPartial’ and no extension method ‘RenderPartial’ accepting a first argument of type ‘System.Web.WebPages.Html.HtmlHelper’ could be found (are you missing a using directive or an assembly reference?)

Clearly, the identifier Html refers to a different class than I expected.

So, is there a tutorial on how to do this? Is it at all possible?

This code:

@Html.GetType().FullName

Outputs this:

System.Web.WebPages.Html.HtmlHelper

I don’t need to use Html as the identifier, if I can create my own variable referring to the right object/type/class instance, that’d be more than enough for me.

  • 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-05-30T00:05:25+00:00Added an answer on May 30, 2026 at 12:05 am

    Clearly, the identifier Html refers to a different class than I expected.

    Yes, it refers to System.Web.WebPages.Html.HtmlHelper which is used by WebPages. In ASP.NET MVC it is the System.Web.Mvc.HtmlHelper class.

    The base class of your template is the WebPage class whereas in ASP.NET MVC it is the WebViewPage class.

    But since you are using WebPages you could rely only on the methods defined by it. For example if you wanted to include a partial you could do the following:

    ~/_SiteLayout.cshtml:

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8" />
            <title>test</title>
        </head>
        <body>
            @RenderBody()
        </body>
    </html>
    

    ~/Default.cshtml:

    @{  
        Layout = "~/_SiteLayout.cshtml";
        Page.Title = "Welcome to my Web Site!";
    }
    <div>Welcome</div>
    
    @RenderPage("Menu.cshtml")
    

    ~/Menu.cshtml:

    @{  
        Layout = null;
    }
    <div>Some menu</div>
    

    web.config:

    <configuration>
        <system.web>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
    </configuration>
    

    You may take a look at the WebPages documentation. There are lots of tutorials out there.

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

Sidebar

Related Questions

I am trying to create a website using the Joomla and virtuemart. But I
I'm trying to create a DLL using a Dataset.XSD file to access my website's
I'm trying to create a simple file upload form for my website. I'm using
I am trying to implement Facebook Connect functionality into a website that I am
I'm trying to create a website for myself and just ran into this issue:
I'm trying to add a payment method to working website that is using a
I'm trying to create a small website in ASP.NET MVC that uses twitter. I
I am trying to create a table for a website that is a fixed
I am trying to create a gui using swing. I have a main frame
I've inherited a website developed using Struts 1.2 that I need to make some

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.