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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:27:04+00:00 2026-05-30T07:27:04+00:00

I have a basic form with some ASP.NET textbox fields laid out and I

  • 0

I have a basic form with some ASP.NET textbox fields laid out and I also have created a control extender which after a change event on a seperate textbox occurs it sets a certain set of textboxes values to blank.

The form I have is a user control which exposes public properties to retrieve the values of the TextBoxs. When the form is submitted and I access the properties, the original values when the page was loaded are coming back instead of the blank or null value. Can someone explain to me why this is happening.

I have a page with the control on it, that control has the textboxs and the properties to expose the textbox values. After client events the populated textboxes are set to blanks. When I submit the form (submit button is on the control, but an event is exposed that I wire up on the parent form) I try to access the controls properties but they contain the original values.

I think this has something to do with the state bag but am not sure.

Any help would be great.

Thank You.

  • 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-30T07:27:06+00:00Added an answer on May 30, 2026 at 7:27 am

    When you change values using ajax/jquery or anything client side the new values don’t interact with the ViewState. Therefore when the page reloads the original values are restored from the ViewState wiping out anything that has happen via ajax.

    This is a fault/feature of the asp.net postback model. I believe it is why the MVC framework has become popular – it doesn’t have postbacks or viewstate at all so plays a lot nicer with AJAX.

    I have got AJAX to work and persist with postbacks but it’s a pain. I did the following

    1. Have a hidden field at that we use to store the client state
    2. For each client change store the change in the hidden field. Because the change will be complex – code up the change in JSON. For instance a string with value/ClientID pairs.
    3. When the page post back – hook in a javascript function to read the state from the hidden field. Parse the JSON to an object and use custom code to reset the field values.

    It’s what I did – there might well be a better answer/work around.

    In short – postbacks destroy AJAX

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

Sidebar

Related Questions

I have been using the ASP.NET AJAX UpdatePanel control a lot lately for some
I have a pretty basic windows form app in .Net. All the code is
i have a form button in the form,which i need to perform basic action
I am working on some ASP.NET web forms which involves some dynamic generation, and
I have a very basic ASP.NET web site. It has a single page (TestPage.aspx)
I have a basic html form that adds some data to the page using
I have some basic form when you type email, old password, new password and
I am doing some basic form validation. I have the following JavaScript function: function
I'm just beinning basic data driven ASP.NET webforms design. I have the first part
We have been using asp.net mvc for development. Sometimes, we need to put some

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.