.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old February 7th, 2002, 09:34 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
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();}

Reply With Quote
  #2  
Old February 15th, 2002, 11:21 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
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();}

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Web page refreshes but data doesn't refresh!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway