Asp net textbox value not updating on postback

The user will then be able to add or remove questions and populate them with text data until a quiz with n questions is created. All the logic for adding the options is in the control, not in the page.

Each added question will also have its own add and remove button so that questions can be added or removed at any location in the quiz. It could have a radiobuttonlist and a "Add Option" button.

Then you add the Question Control dynamically like this: Question Control qc = this.

Load Control("Question The Page Load fires before the click handler.

So I wrote a small event handler that reinitializes the databinding for the datasource and the gridview itself and attached it to all of the controls Selected Index Changed events, but still no database interaction happens.

I've put a on the page just so I can tell that the postback is happening, and it is, every timea control is changed.

I've also tried just binding the datasource and gridview in the page_load method if it's a postback, but neither gives me results... can you make a very trivial example with just one select field and an almost nothing gridview?

calling databind() on the gridview, in my experience, always causes the select to be executed and then a round trip to the database which you should see in profiler.

I am tracing the page and can see that the saveviewstate event is firing. Event Args e) So the idea is when you click Add Question you do just that: add the new question (one question) and increase the counter.

When the page is first loaded it will contain only one question. Perhaps I will simply create another user control to nest within the first. The idea is to load the control on the page and it does whatever it has to do.

This question will have both an "add" and a "remove" button. The page itself doesn't need to know how the question is rendered or the options.

So what I'd like is for the gridview to update every time a value is changed in the any of the form fields.

I set them all (except the text boxes of course) to Auto Postback, but when any of the dropdownlists are changed the query is not sent to the database and the gridview continues to display the empty dataset message.

Search for asp net textbox value not updating on postback:

asp net textbox value not updating on postback-62asp net textbox value not updating on postback-53asp net textbox value not updating on postback-29asp net textbox value not updating on postback-23

I also have SQL Profiler running and I can see that the query ius NOT being sent to the database on postback.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “asp net textbox value not updating on postback”

  1. Telling her how you pissed your bed when you were 25 just comes off as immature and a bit sad. [Read: The art of using self deprecating humour to make her fall for you] #6 Avoid negativity at all costs.