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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:11:56+00:00 2026-05-15T01:11:56+00:00

Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed

  • 0

Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed in these new brackets <%: Content %> should be rendered as HTML encoded.

I’ve tried this within a databound label in a FormView like so:

<asp:Label ID="MyLabel" runat="server" Text='<%: Eval("MyTextProperty") %>' />

But it doesn’t work: The text property contains script tags (for testing), but the output is blank. Using the traditional way works:

<asp:Label ID="MyLabel" runat="server"
    Text='<%# HttpUtility.HtmlEncode(Eval("MyTextProperty")) %>' />

What am I doing wrong?

(On a sidenote: I am too stupid to find any information: Google refuses to search for that thing. The VS2010 Online help on MSDN offers a lot of hits, but nothing related to my search. Stackoverflow search too. And I don’t know how these “things” (the brackets I mean) are officially called to have a better search term.)

Any info and additional links and resources are welcome!

Thanks in advance!

  • 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-15T01:11:56+00:00Added an answer on May 15, 2026 at 1:11 am

    You are confusing data binding expressions, which have the syntax <%#%> and are used with Eval (and Bind) with the response output tags (<%=%> and <%:%>) that cannot be used with Eval.

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

Sidebar

Related Questions

I accidentally come across this page new keyword in method signature and I found
Today when I was doing some experiments with == , I accidentally found out
.NET newbie alert Using Visual C# 2008 Express Edition I have accidentally created a
The border shadow effects used in the images of this blog post seem to
I've recently started working on a web app with a new company and found
I found this unexpected behavior with SQLite. It appears that SQLite accepts arbitrary keywords
I'm fairly close to going on a murderous rampage about this so if someone
I accidentally found zombie transaction is mentioned in SqlTransaction code. So, what is zombie
Accidentally I may forget to describe some parameters or exception throwing (or something else)
Accidentally I mixed up between 32Bit and 64Bit library files on my x86 embedded

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.