473,473 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problematic Postbacks

Most probably, you are loading the data to the label
before you submit the update.

I dealt with that type of an isssue before, you question
is not descriptive enough to make certain decisions, but i
guess your control is data bound, you are loading the data
in page_load, then the button_click sends the update, and
you are binding data after the update, BUT NOT RETRIEVING
THE DATA AGAIN. So debug the code to make sure that the
events are in this order starting with the button click :

1) The update button is clicked
2) The code to update the database is called
3) The code to retrieve the updated data is called
4) The code to bind the updated data to the label is
called.

Make sure step 3 occurs AFTER the data update code.
I had a complaint exactly like yours in which the order
was 3,1,2,4...

Being more specific, the dataset that used to bind the
value was being loaded in the page_load,
which fires before the button_click ,
then the update code was being called in Button_Click,
and then the databinding code was being called after the
update,
which leaves you with the previous values you loaded in
page_load.

On the second click, you get the data you updated in the
first click, send the update, bind the data, bumm, you get
the first update just now. So you are one cycle behind the
actual value...

The firing order of the basic events are:
Page_Init
Page_Load
Button_Click
Page_PreRender
The code in <% %> on the aspx page (if you have any
databinding in the aspx page like DataSource='<% ds1 %>')
Hope it helps..

Duray AKAR
-----Original Message-----
I have been having this problem sporadically for the past year. The basicissue is this, during a postback (say a button press), i make a change tothe state of the application (say, update a database), and call methods thatshould update the status of the page to reflect it. However, the Page doesnot update until the SECOND time the button is pressed. However, the changesare made on the first press (checked the databasE). Example. There is alabel displaying the current poll number. It is a databound control. I use adatagrid to select another poll number and click the update button. Nothinghappens, but in the databse, the current poll has updated. I pick anotherpoll from the datagrid and hitr update, and the FIRST poll i picked isdisplayed. However, in the database, it is updated with the new information.Does anyone have any insight on this matteR? Thanks.


.

Nov 17 '05 #1
0 917

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim Mitchell | last post by:
OK, have I come full circle.... ? 1) .NET with VS Studio seemed to be the answer to all my prayers. A) No more worries about coding for Netscape vs. IE. B) Quick Deployment C) All code in...
6
by: Jon Maz | last post by:
Hi All, I am experimenting with URL Rewriting using the techniques outlined by Scott Mitchell in his article "URL Rewriting in ASP.NET"...
3
by: Nelson | last post by:
My development environment is ASP.Net with VB.Net and .Net Framework 1.1. For a web control text box through client code(java script) I am changing the font color. After post the color is...
5
by: Dave | last post by:
(Second Try) Greetings, I have an asp.net web application that utilizes a User Control at the top of the page. My User Control contains a Server Control menu which will require postbacks. ...
3
by: John | last post by:
I have an asp.net control which on the first Load of the page has a unique ID something like: _ctl0__ctl1_GroupName__ctl1_ControlName and after the first postback it changes to: ...
1
by: Frankie | last post by:
Just doing some testing here to see what happens when JavaScript is disabled. I was told somewhere along the line that PostBacks would fail because they rely on JavaScript: function...
1
by: satish.vell | last post by:
Hi, I have a ASP.NET page inside which I toggle the display of a field using javascript. How can I save this display value between postbacks. Here is my code: <pre>
0
by: gregfocker | last post by:
I installed the new RTM version of ASP.NET 2.0 AJAX Extensions 1.0 released on Tuesday (1/23). I made the required changes to the web.config file to go from the RC version to the RTM version. ...
1
by: Kursat | last post by:
Hi, I have a question about Ajax postbacks : - Does ASP.NET process multiple UpdatePanel postbacks in single thread when two or more different update panel postbacks occur at the same time for...
4
by: Nathan Sokalski | last post by:
I have 2 private variables in my class that I need to remember the values of between postbacks (or actually callbacks, since I am using AJAX). I want to avoid using session variables, if possible....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.