Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2007, 03:33 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic Net 2 Chapter 8 Page270

I'm trying to update existing records, as 'in try it out' P270 and have run into a problem. When I Update an entry I have to close the connection to the browser and reopen it for the change to take effect on the page I'm working on.What am I doing wrong? Can anyone help, please? I found chapter 7 was a bitch,so many errors that aren't covered in the pages of errata, one has to wade through these forums to find the answers. One would think that the errata would be updated as the faults become apparent!
That's my only gripe, so far!

 
Old April 30th, 2007, 04:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

Hi sevans,

Are you working with VB or C# code? I'm guessing VB but want to check before I reply.

Dan

Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
 
Old May 2nd, 2007, 02:33 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dan,
Thanks for the reply. I'm working with VB.
Looking forward to an answaer to my problem.
Regards

 
Old May 3rd, 2007, 04:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

Hi sevans,

OK, the brief answer is that if you update say the opposition team in one control (say, the GridView) it won't be reflected in the other control (say, the DetailsView) because the values shown in that control are stored in ViewState and aren't refreshed until you either reopen the browser or force the page to update the viewstate for that control by making it change - the easiest way to do it is to try and edit the same match details in the control and when you click edit, the value you changed in the other control will appear in the other one.

So why does it work this way? Basically, it's to reduce the number of times data is retrieved from the database - if the two controls used the same datasource, they would both update, but they don't.

Is there a way to change this? Yes. You can disable ViewState for both GridView and DetailsView in two ways.

1. Select the GridView in design view on fixtures.aspx. In the properties window, set EnableViewState to false. Repeat for the DetailsView.
2. Switch to code view for fixtures.aspx. In the top line <% @Page ... /> add EnableViewState="false" among the properties. VWD's autocomplete will help here.

Note that option 2 switches ViewState off for the entire page here, and not just the GridView and DetailsView. This doesn't matter too much for this page as it's just a demo for updating data to a database but I think it's worth noting that sometimes this isn't always the best thing.

Anyway, I hope that helps.

Dan

Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
 
Old May 8th, 2007, 05:19 AM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dan,
Thanks for the reply and it works a treat; Did I miss something in the text?
Regards
sevans

 
Old May 30th, 2007, 06:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

I checked the text as well - I don't think so.

Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
 
Old November 5th, 2007, 03:15 PM
Registered User
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually yes I believe you missed something in the text. On page 277-278 it talks about this refreshing problem.

To solve this, you would have to insert the DataBind() method in each of the controls. Once you do that, it will then refresh the other data in other controls.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic .NET and processes trailro VB How-To 0 October 21st, 2008 12:30 PM
visual basic.net pringlesoft VB.NET 2 February 11th, 2008 01:46 PM
Rowfilter in Visual Basic.Net ahooi ASP.NET 1.0 and 1.1 Basics 0 July 5th, 2005 03:51 AM
chapter 20 basic authentication egivler BOOK: Beginning ASP.NET 1.0 3 June 29th, 2004 09:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.