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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:24:54+00:00 2026-05-10T17:24:54+00:00

With ASP.NET’s view engine/template aspx/ashx pages the way to spit to screen seems to

  • 0

With ASP.NET’s view engine/template aspx/ashx pages the way to spit to screen seems to be:

<%= Person.Name %> 

Which was fine with webforms as alot of model data was bound to controls programatically. But with MVC we are now using this syntax more oftern.

The issue I have with it is quite trivial, but annoying either way. This is that it seems to break up the mark up i.e.:

<% foreach(var Person in People) { %>     <%= Person.Name %> <% } %> 

That seems like alot of opening and closing tags to me!

Other view engines in the MVC contrib have a means of spitting to screen with out opening and closing the script tags using standard keyword such as ‘print, out, echo’ i.e. (brail example):

<%  for element in list:       output '<li>${element}</li>'  end %> 

Now, I said this may seem trivial, but it just seems more readable this way. So what are the advantages of MS having this syntax, and not providing a output method?

Cheers, Chris.

  • 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. 2026-05-10T17:24:54+00:00Added an answer on May 10, 2026 at 5:24 pm

    Consider something like this, instead:

    <% foreach(var Person in People) {      Response.Write(Person.Name);  } %> 

    I believe that’ll work. (Although I haven’t tested it; I’ve only just begun with MVC and don’t have the toolset here at the office.)

    EDIT: I apparently missed the actual question … 🙂

    Microsoft does provide an output method, but didn’t provide a syntax like the one you describe. The output method is Response.Write(). I can’t answer this directly (I believe you’ll need to check with Scott Hanselmann over at MS :)), but I think they didn’t want to complicate scripting by adding yet-another-language for us to learn; I think they wanted to leverage the languages (C#, VB, etc.) which developers already knew.

    EDIT #2: I placed the following in a comment, and in retrospect (for completeness), it should be part of the answer.

    If you head over to the Learn MVC site on ASP.NET, in the view tutorial (that’s the link), you’ll see the following paragraph:

    Since you call Response.Write() so often, Microsoft provides you with a shortcut for calling the Response.Write() method. The view in Listing 3 uses the delimiters <%= and %> as a shortcut for calling Response.Write().

    Essentially, <%= %> is the accepted shortcut for Response.Write, and you therefore can use the full Response.Write method anywhere you’d use <%= %>.

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

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer By loaded, do you mean entirely loaded, or with no… May 11, 2026 at 10:11 am
  • added an answer This is perfectly analogous to how maps (the most natural… May 11, 2026 at 10:11 am
  • added an answer Take a look in %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\ for the platform(s) you… May 11, 2026 at 10:11 am

Related Questions

With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one
With ASP.NET's view engine/template aspx/ashx pages the way to spit to screen seems to
With ASP.NET 3.5 I can easily bind to an XML file by using an
With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web
I am working with ASP.net. I am trying to call a method that exists
I'm playing with ASP.NET MVC for the last few days and was able to
I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now,
I am playing around with ASP.NET MVC for the first time, so I apologize
I've been working with ASP.NET MVC for the last few weeks, learning as I
I've been fiddling with ASP.NET MVC since the CTP, and I like a lot

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.