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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:02:05+00:00 2026-06-18T00:02:05+00:00

Possible Duplicate: ASP.NET special tags I am trying to understand an MVC application. It

  • 0

Possible Duplicate:
ASP.NET “special” tags

I am trying to understand an MVC application. It has multiple user controls. In these controls I see syntax like:
<%= ...some text ... %>

I have also seen:
<%: ...some text ... %>
<@ ...some text ... %>
<% ...some text ... %>
<%# ...some text ... %>

I can see that it enables me to write code in the control/javascript but I don’t fully understand the difference between %, %:, %= and %#.

When are they “executed/evaluated”?

Is there a difference if <%= ... => is in a user control or enclosed in single quotes in a Javascript function?

I am not even sure if my title is correct, I don’t get anything when googling it.
So I would be delighted with an explanation, more than happy with a link to documentation and happy with the correct terminology.

  • 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-18T00:02:06+00:00Added an answer on June 18, 2026 at 12:02 am

    Assuming you are using the WebForms view engine in ASP.NET MVC all you need to know are the following :

    • <%= %> – Output the result of the evaluation of the input to the response. For example <%= "<div>foo</div>" %> outputs <div>foo</div>.
    • <%: %> – Same as the first one except that it HTML encodes the output. Thus <%: "<div>foo</div>" %> will output &lt;div&gt;foo&lt;/div&gt;.
    • <% %> – Evaluates the expression on the server but doesn’t output anything in the response. For example you could declare a variable: <% string foo = "foo bar"; %> that you could use later to output with one of the 2 previous methods
    • <%@ %> – This is only used to define the Page or Control directives of the view. It also allows you to bring namespaces and assemblies into scope for the given view. For example <%@ Import Namespace="System.IO" %> will bring the System.IO namespace into scope.

    As far as <%# is concerned, this is not used in ASP.NET MVC. It is a concept called data binding and works only in classic WebForms applications.

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

Sidebar

Related Questions

Possible Duplicate: ASP.NET “special” tags What is the difference between <%# ... %> ,
Possible Duplicate: ASP.NET “special” tags Is there a proper name for <%...> in ASP.NET,
Possible Duplicate: File Upload ASP.NET MVC 3.0 I am trying to just print out
Possible Duplicate: Schedule Controls for ASP.Net MVC I have MVC3 in which I want
Possible Duplicate: HTML.ActionLink method In my ASP.NET MVC 3 application, I wish to generate
Possible Duplicate: ASP.NET MVC on IIS 7.5 I am trying to deploy a basic
Possible Duplicate: ASP.NET MVC - Can i have multiple names for the same action?
Possible Duplicate: ASP.NET MVC - View with multiple models Using ASP.NET MVC 3.0, how
Possible Duplicate: ASP.NET “special” tags I hope this isn't too much of a newbie
Possible Duplicate: ASP.NET “special” tags What is the difference between <%: %> and <%=

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.