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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:13:24+00:00 2026-05-22T03:13:24+00:00

On a .aspx page, what is the best way to link a server control’s

  • 0

On a .aspx page, what is the best way to link a server control’s property to a property of the page class (its code-behind)? The only way that I have read about is to use databinding:

<asp:TextBox ID="txt" runat="server" Text='<%# Me.SomePropOfMine %>' />

and then call Me.txt.DataBind() or Me.Databind() from the codebehind. Is there any way of establishing this relationship on the .aspx page alone, or simplifying the process if you have many controls to bind (without binding the entire page)?

  • 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-22T03:13:25+00:00Added an answer on May 22, 2026 at 3:13 am

    You can Databind() entire Me or a container control (you can add a PlaceHolder control around your desired controls also). because DataBind() goes recursively on Child controls.

    A better approach if you don’t need DataBinding except for this is to use Code Expression Binder

    http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx

    This allows you to use <%$ Code: Me.Property %> instead of <%# Me.Property %>.

    For more about expression builders in general if you don’t know them at all check this intro post:
    https://web.archive.org/web/20210304125044/https://www.4guysfromrolla.com/articles/022509-1.aspx

    Note that <%= Me.Property %> will NOT work on web controls like <asp:TextBox ... and such…

    P.S.

    The only drawback with Code expression builder is that you get no intellisense. I usually work around this by writing <%= Me.TestSomething %> inside the markup to get my intellisense, and then replace <%= with <%$ Code: when done. Annoying, but if you don’t want to go the DataBind() route (and you shouldn’t cause it may conflict with existing real data binding you want to do. Trust me, trying to make those work is hell), then this is the way to go.

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

Sidebar

Related Questions

What is the best way to close an ASPX page from the code-behind? I
Which is Best way to send data to aspx page, and why ? using
I have an ASPX page and on this page I have a control that
I have an Send.aspx page that has an uploadify control on it. Upload.ashx handles
Whats the best practice for implementing a confirmation page in .Net? I've used response.redirect(Thankyou.aspx)
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have an ASPX page where I am uploading an image to server for
I'm trying to determine the best way to implement a 404 page in a
I have simple aspx page that has a form and a input field in
I have some simple code in an aspx page <object width=550 height=400> <param name=movie

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.