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

The Archive Base Latest Questions

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

A simple question, I think: I want to put a tag into an ASP.NET

  • 0

A simple question, I think:

I want to put a tag into an ASP.NET app I’ve been asked to maintain, so I’m coming at this from a newbie point of view just tinkering around the edges without knowing a lot.

I wrote an old ASP application back in 1998, so I am just running on memory…

How do I write some output to the webpage?

I know I can use an

<asp:label id="blah">

but then I need to define a Label blah; in my code behind and then assign it.

I believe that I can put in-place:

<% Response.Write("sometext"); %> 

and that will write sometext in the location within the page. (Am I correct?)

Lastly, I remember there was a syntax to the effect of

<%= "some string" %> 

but I can’t find the documentation on it, to say either it is deprecated, unadvised, or the rationale for such a decision.

I have tried googling for “ASP.NET grammar” but I can’t even find a good description that “<%=” even exists, though it is mentioned in a few blogs.

For something simple, like inject the global version number, or the current date, then I can’t see anything particularly wrong with in-place composition – it would save me defining 15 labels and having to initialise them all – though perhaps the asp:label approach could reference one global instance of a label?

Just asking for opinions on good practices 🙂

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

    <%= string %> is perfectly valid ASP.NET syntax. The reason you will often find references to problems with using that is people use <%= (equivalent to Response.Write) when they should use <%# (for databinding) or vice-versa.

    For example, we use it very extensively in our content managed site, where we pull in values from a global settings repository:

    <%= SiteContext.Current.GetSetting("SiteTitle") %>
    

    MSDN:

    • MSDN entry on <%= (this is under the JScript.NET section but still applies)
    • MSDN entry on <%#

    Some others suggest <%= is not a “best practice” or a very good approach, but I strongly disagree with that sentiment. For an MVC-ish type site (especially a site that is template- or view-driven in some way), the most direct approach is frequently more effective than using server controls.

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

Sidebar

Related Questions

This is a simple question I think. I am trying to search for the
I think this is a simple question, but I can not find the answer
I think this is a simple question. How do I disable copy from a
i think this is a simple question but I've searched around and can't seem
I think this is a pretty simple question. How do you an apache rewrite
I imagine this question has been asked and answered, but I cannot find it.
Simple question, I think. I have org.springframework.scheduling.quartz.CronTriggerBean triggering one job once a day. Because
Simple question, I should think. Unfortunately, I couldn't figure out how to get it
I think its a rather simple question but I couldn't really find an answer
I have -- what I think -- is a simple question. Here's my code:

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.