|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Web page refreshes but data doesn't refresh!!!
Originally posted by : Richard (xiao_john@yahoo.com)I want to update the data in the database after click on correspondingbutton, and then the web page should refresh and the old data should begone. But something strange is that, after clicking the button, the data indatabase is updated, but the data in the web page is still the old data!!!(But I see it refresh!)Then if I click on other buttons, the data will be updated is notcorresponding data but nearby data!! If I refresh web pages by myself, allthe data in web page will be updated one by one just like their buttons areclicked!!What's going on??? Is this actually the situation you mean?void SubmitBtn_Click(Object sender, EventArgs e){Button myControl = ( Button ) sender ;OleDbConnection MyConnection2 = new OleDbConnection(MyConnString);string strDelete = "update Personal set Valid = 'N' where Name='" +myControl.CommandArgument + "'";Message.Text = strDelete;OleDbCommand deleteCommand = new OleDbCommand(strDelete, MyConnection2);MyConnection2.Open();deleteCommand. ExecuteNonQuery();MyConnection2.Close();}
|
|
#2
|
|||
|
|||
|
Originally posted by : Pradeep Kini (pradeep.kini@jenzabar.net)Make sure you check the IsPostBack() flag in the Page_Load event before refresing the data.Refresh the data only if Not IsPostBack().Eg: If (Not Page.IsPostBack) Then Do Data Retrieval Process End IfI had the similar problem and this solved it. I am not sure if your is a similar situation or not, but I hope this helps.Thabnks------------Richard at 2/7/2002 7:34:48 PMI want to update the data in the database after click on correspondingbutton, and then the web page should refresh and the old data should begone. But something strange is that, after clicking the button, the data indatabase is updated, but the data in the web page is still the old data!!!(But I see it refresh!)Then if I click on other buttons, the data will be updated is notcorresponding data but nearby data!! If I refresh web pages by myself, allthe data in web page will be updated one by one just like their buttons areclicked!!What's going on??? Is this actually the situation you mean?void SubmitBtn_Click(Object sender, EventArgs e){Button myControl = ( Button ) sender ;OleDbConnection MyConnection2 = new OleDbConnection(MyConnString);string strDelete = "update Personal set Valid = 'N' where Name='" +myControl.CommandArgument + "'";Message.Text = strDelete;OleDbCommand deleteCommand = new OleDbCommand(strDelete, MyConnection2);MyConnection2.Open();deleteCommand. ExecuteNonQuery();MyConnection2.Close();}
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Web page refreshes but data doesn't refresh!!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|