Ask a Question related to ASP.NET General, Design and Development.
-
Lim Siew Cheng #1
Re: Problematic Postbacks
this may be a stupid response,
after updating the database, how about rebounding the label ?
news.microsoft.com wrote:> I have been having this problem sporadically for the past year. The basic
> issue is this, during a postback (say a button press), i make a change to
> the state of the application (say, update a database), and call methods that
> should update the status of the page to reflect it. However, the Page does
> not update until the SECOND time the button is pressed. However, the changes
> are made on the first press (checked the databasE). Example. There is a
> label displaying the current poll number. It is a databound control. I use a
> datagrid to select another poll number and click the update button. Nothing
> happens, but in the databse, the current poll has updated. I pick another
> poll from the datagrid and hitr update, and the FIRST poll i picked is
> displayed. However, in the database, it is updated with the new information.
> Does anyone have any insight on this matteR? Thanks.
>
>
>
>Lim Siew Cheng Guest
-
Conversion from 1.5 to 2.0 problematic
I'm having trouble converting documents from InDesign 1.5 to 2.0 -- during the "Open Document" phase, the "converting data" bar gets to about 35% and... -
Fwd: [PHP-DEV] ZEND_DISABLE_MEMORY_CACHE=0 problematic on
FYI, this should be fixed now. If anyone still bumps into weird performance problems relating to the memory manager please let me know. Andi ... -
[PHP-DEV] ZEND_DISABLE_MEMORY_CACHE=0 problematic on large arrays
http://cvs.php.net/diff.php/ZendEngine2/zend_alloc.c?r1=1.118&r2=1.119&ty=h&num=10 " - Add heap to memory manager. This should improve... -
Problematic delay in script
Hello, I have created a mailing program for our company that sends out emails to our client database. There seems to be a delay in the script or... -
problematic behaviour of movies using XML parser scripts in shockwave - !!!
hi, all! we are in the process of testing XML parsing in shockwave and publishing some movies on the internet, that all of them use the XML... -
David Wier #2
Re: Problematic Postbacks
Just a stab in the dark, here, but do you manually close your connection
(the one for inserting/updating the data) before you rebind?
David Wier
[url]http://aspnet101.com[/url]
[url]http://aspexpress.com[/url]
"news.microsoft.com" <sjvanterpool@hlscc.edu.vg> wrote in message
news:uZ$XcHPYDHA.2448@TK2MSFTNGP09.phx.gbl...methods> I do that, but it only shows up on the SECOND postback.
> "Lim Siew Cheng" <siew_cheng555@yahoo.com> wrote in message
> news:3f39165b$1@news.starhub.net.sg...> basic> >
> > this may be a stupid response,
> > after updating the database, how about rebounding the label ?
> >
> >
> >
> > news.microsoft.com wrote:> > > I have been having this problem sporadically for the past year. The> to> > > issue is this, during a postback (say a button press), i make a change> > > the state of the application (say, update a database), and calla> that> does> > > should update the status of the page to reflect it. However, the Page> changes> > > not update until the SECOND time the button is pressed. However, the> > > are made on the first press (checked the databasE). Example. There is> use a> > > label displaying the current poll number. It is a databound control. I> Nothing> > > datagrid to select another poll number and click the update button.> another> > > happens, but in the databse, the current poll has updated. I pick> information.> > > poll from the datagrid and hitr update, and the FIRST poll i picked is
> > > displayed. However, in the database, it is updated with the new>> >> > > Does anyone have any insight on this matteR? Thanks.
> > >
> > >
> > >
> > >
>
David Wier Guest
-
news.microsoft.com #3
Re: Problematic Postbacks
I do that, but it only shows up on the SECOND postback.
"Lim Siew Cheng" <siew_cheng555@yahoo.com> wrote in message
news:3f39165b$1@news.starhub.net.sg...basic>
> this may be a stupid response,
> after updating the database, how about rebounding the label ?
>
>
>
> news.microsoft.com wrote:> > I have been having this problem sporadically for the past year. Theto> > issue is this, during a postback (say a button press), i make a changethat> > the state of the application (say, update a database), and call methodsdoes> > should update the status of the page to reflect it. However, the Pagechanges> > not update until the SECOND time the button is pressed. However, theuse a> > are made on the first press (checked the databasE). Example. There is a
> > label displaying the current poll number. It is a databound control. INothing> > datagrid to select another poll number and click the update button.another> > happens, but in the databse, the current poll has updated. I pickinformation.> > poll from the datagrid and hitr update, and the FIRST poll i picked is
> > displayed. However, in the database, it is updated with the new>> > Does anyone have any insight on this matteR? Thanks.
> >
> >
> >
> >
news.microsoft.com Guest
-
IbrahimMalluf #4
Re: Problematic Postbacks
Hello
What is probably happening is that you ar referencing control values
directly as in MyResult=MyLabel.Text. There is a latency between the
control value on postback and the actual changed values. If you are using a
control's value change to initiate the postback then getting the current
value is easy...you use the 'SENDER' argument of the event to get the actual
value:
Sub MyText_Changed(sender as object, e as systeme.arguments)
Dim CurrentText as TextBox = DirectCast(Sender, TextBox)
End Sub
In the case above, the CurrentText object has the currently changed value as
opposed to MyText that latently holds the original value before the change.
I am guessing that you are somehow repopulating the display with latent
data. Not seeing your code it's hard to tell but your problem description
fits that latency scenerio I described above.
Ibrahim
"news.microsoft.com" <sjvanterpool@hlscc.edu.vg> wrote in message
news:uZ$XcHPYDHA.2448@TK2MSFTNGP09.phx.gbl...methods> I do that, but it only shows up on the SECOND postback.
> "Lim Siew Cheng" <siew_cheng555@yahoo.com> wrote in message
> news:3f39165b$1@news.starhub.net.sg...> basic> >
> > this may be a stupid response,
> > after updating the database, how about rebounding the label ?
> >
> >
> >
> > news.microsoft.com wrote:> > > I have been having this problem sporadically for the past year. The> to> > > issue is this, during a postback (say a button press), i make a change> > > the state of the application (say, update a database), and calla> that> does> > > should update the status of the page to reflect it. However, the Page> changes> > > not update until the SECOND time the button is pressed. However, the> > > are made on the first press (checked the databasE). Example. There is> use a> > > label displaying the current poll number. It is a databound control. I> Nothing> > > datagrid to select another poll number and click the update button.> another> > > happens, but in the databse, the current poll has updated. I pick> information.> > > poll from the datagrid and hitr update, and the FIRST poll i picked is
> > > displayed. However, in the database, it is updated with the new>> >> > > Does anyone have any insight on this matteR? Thanks.
> > >
> > >
> > >
> > >
>
IbrahimMalluf Guest
-
Duray AKAR #5
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
year. The basic>-----Original Message-----
>I have been having this problem sporadically for the pastmake a change to>issue is this, during a postback (say a button press), iand call methods that>the state of the application (say, update a database),However, the Page does>should update the status of the page to reflect it.However, the changes>not update until the SECOND time the button is pressed.Example. There is a>are made on the first press (checked the databasE).databound control. I use a>label displaying the current poll number. It is aupdate button. Nothing>datagrid to select another poll number and click theupdated. I pick another>happens, but in the databse, the current poll haspoll i picked is>poll from the datagrid and hitr update, and the FIRSTthe new information.>displayed. However, in the database, it is updated with>Does anyone have any insight on this matteR? Thanks.
>
>
>
>
>.
>Duray AKAR Guest
-
news.microsoft.com #6
Re: Problematic Postbacks
Here's the code:
private void buttonCurrent_Click(object sender, System.EventArgs e)
{
generalDataSet1.CurrentPoll.AddCurrentPollRow(int. Parse(this.DataGrid1.DataK
eys[this.DataGrid1.SelectedIndex].ToString()),DateTime.Now);
this.daCurrentPoll.Update(generalDataSet1);
generalDataSet1.CurrentPoll.Clear();
daCurrentPoll.Fill(generalDataSet1,"CurrentPoll");
this.labelCurrentPoll.DataBind();
}
news.microsoft.com Guest



Reply With Quote

