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

  • Home
  • SEARCH
  • 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 354491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:55:45+00:00 2026-05-12T11:55:45+00:00

Sometimes I do despair when working with ASP.Net – another problem that shouldn’t be!

  • 0

Sometimes I do despair when working with ASP.Net – another problem that shouldn’t be!

On the web form there is an ASP table. In the ASP table there is a user control which I am making some changes to. In the ASP table there is a text box….nothing out of the ordinary so far!

In the code behind, as part of the Page_Load, I need to access the ClientID of the textbox in order to register some javascript…so I do and the javascript seems to do everything it needs to. Everyone’s happy.

No, no apparently everyone’s not happy, ASP.Net itself is very unhappy!

On accessing the ClientID, the id that appears in the source is:

myControl_myTextBox

commenting out the line that accesses the ClientID means the id is rendered as:

ctl00_BodyPlaceHolder_myControl_myTextBox

The line that accesses the ClientID looks like this:

jsBuilder.AppendFormat(@"var filter = new TBFilter($(""#{0}"")[0]);", myTextBox.ClientID);

This in itself does not bother me, but the fact that it breaks the postback, does! If you type something into that textbox and hit the submit button (there’s a submit button on the page!), it reloads the page, but puts the default value back in the textbox and completely ignores what you originally had. Madness – I haven’t done anything particularly weird and out of the ordinary, so why has it broken the postback?

  • 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-12T11:55:45+00:00Added an answer on May 12, 2026 at 11:55 am

    The javascript you register in page load, does that do something that should not happen in a postback? If so, you should check on the Page.IsPostback to control when to use it.

    You should also be aware that in the page life cycle, Page_Load occurs before any control postback events (which is for instance Click event on button). So if the javascript code you register depends on result from the Click event, you should either register it inside the Click event (if it should only happen when clicked on that button), or the Page_PreRender event (if it should always happen).

    EDIT:
    It also might be that some changes are made after Page_Load to how the client id’s are created. It may be best to do it in the Page_PreRender event to make sure everything is finished loading.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer my @files = glob("*.test"); foreach my $file ( @files) {… May 12, 2026 at 8:26 pm
  • Editorial Team
    Editorial Team added an answer If the property isn't accessed then all it will cost… May 12, 2026 at 8:26 pm
  • Editorial Team
    Editorial Team added an answer You can make the request on a separate thread, which… May 12, 2026 at 8:26 pm

Related Questions

Sometimes I do despair when working with ASP.Net - another problem that shouldn't be!
Sometimes I get a broken background in Chrome. I do not get this error
Sometimes I really wonder if my code is lastable. I do everything to make
This error happened after updating to latest may 2009 CTP. Sometimes I do not
Sometimes I need to learn the type of an expression while programming in C

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.