Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 20th, 2008, 05:43 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12: Page 410 - Try it out

I'm enjoying chapter 12 so much that I am taking my time and experimenting. LOL

I was wondering if you could give me some hints on how to deal with the following problems (just hints so I can try to figure it out myself):

When I click on Jazz in the Reviews page, then on a title, I go to the AddEditReviews page. I have no way of going back to the Reviews page while (postback ?) where it remembers the list of items under Jazz. I have to click refresh and choose the item again.

Do I use need to create some sort of postback to remember???

When you click the cancel button, it clears the form is there is text in it. Can you give me a few hints on how to do the following:

1.) Create a postback so it will remember the item I chose while it displays the list.

2. Change the details view from

Update | Cancel

to

Update | Clear | Cancel

where Clear will do what cancel presently does and the new Cancel will postback to the Reviews showing the title and list of items previously chosen.

I hope I haven't confused you.

Thanks,
Terry
Reply With Quote
  #2 (permalink)  
Old April 20th, 2008, 05:51 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I mean viewstate or something... sorry, it's just before 4 am and I've been at it for about 3 hrs.
Reply With Quote
  #3 (permalink)  
Old April 20th, 2008, 06:37 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

PostBacks and ViewState are not going to help you here. They are used on a page that posts back to itself. In this case, however, you are redirected to a new page which means ViewState from the previous page is lost.

Usually, this is solved by using Query Strings. When you redirect to AddEditReviews you could also send the selected category ID. Then in AddEditReviews you can use that to redirect a user back to the previous page, like this:
Code:
Response.Redirect(string.Format("Reviews.aspx?CategoryId={0}", _
       Request.QueryString.Get("CategoryId"))
       Then in Reviews.aspx you can use Request.QueryString.Get("CategoryId") again to preselect the right categories.

Does that help?

With regards to the Update Cancel issue, I think you probably want to drop the CommandField (which is responsible for the Update and Cancel buttons), and replace it with custom buttons with their CommandName set to the appropriate actions like Cancel.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #4 (permalink)  
Old April 20th, 2008, 03:44 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does it help? I said a hint, not tell me how to do it, hahaha.

I must have read and heard that PostBacks and ViewStates to itself 100's of times but I keep forgetting. This time I think I will remember. You gave me enough info to know what I need to look for to make the changes.

Appreciated Imar,

Terry

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 12 (page 400) Try It Out: Applying Filter Deepeshk BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:18 AM
Errors on Chapter 12 example(12.8) sonnie ASP.NET 2.0 Professional 2 June 7th, 2006 10:55 AM
Minor textual error chapter 12 bottom of page 406 haguna BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 April 16th, 2006 05:48 PM



All times are GMT -4. The time now is 04:18 PM.


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