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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:50:30+00:00 2026-06-04T22:50:30+00:00

I am trying to use a Razor template to produce a .aspx page as

  • 0

I am trying to use a Razor template to produce a .aspx page as output. I’m not having luck looking in the documentation for how to do this. The Page and namespace declarations are breaking the template:

<%@ Page Language="C#" Title="@Page.Metadata.browser_title" %>
<%@ Import Namespace="System.Xml" %>

These are causing this error:

TemplateCompileException: CS1501: No overload for method ‘Write’ takes 0 arguments Line 27 Column 1: Write();

I assume this is because Razor templates using C# syntax makes the two conflict, since the declarations above use “@”. Is there a way to get them to work together so a Razor template can produce an output with C# in the rendered product after the template is run? The example above also shows how the value for “Title” needs to be rendered out of the template.

  • 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-04T22:50:32+00:00Added an answer on June 4, 2026 at 10:50 pm

    The @s in the <% are invalid Razor syntax.
    You need to escape them by writing <%@@.

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

Sidebar

Related Questions

I'm trying to generate fairly simple xml using razor template engine. This is my
I'm trying to use a ternary operator in Razor, similar to this question ,
I am trying to output a value to the page using MVC razor of
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am need paint my image. I'm trying use JQuery in here this link:
I'm developing an MVC3/razor application, and I am trying to use the subGridRowExpanded to
Is there any documentation on how to use the Razor view engine using ASP.NET
I'm trying to figure out the proper way to write this using Razor syntax:
I am trying to use Meleze.Web - 1.0.0 to minify the razor views of
Hi I am using razor and trying to use regular expression to validate email

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.