Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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 December 8th, 2003, 06:27 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jhock7
Default Chapter 3, listpage2.aspx

Step number 3 on page 110, the initial web page would contain the line "You have selected: " unless a Page.IsPostBack is tested as in the following script block:

<script runat="server" language="VB">
   Sub Page_Load()
      If Page.IsPostBack then
           Dim msg As String = "You have selected: <br />"

           If list1.Items(0).Selected Then msg = msg & list1.Items(0).text & "<br />"
           If list1.Items(1).Selected Then msg = msg & list1.Items(1).text & "<br />"
           If list1.Items(2).Selected Then msg = msg & list1.Items(2).text & "<br />"

           Message.Text = msg
      End If
   End Sub
</script>

Would you agree?


Jeffrey A. Hock
 
Old December 9th, 2003, 01:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, I don't think so. The initial page would be empty. As soon as you post back, Message will contain "You have selected: <br />" + the selected value of an item in the drop down.

Why do you think it would contain the message: You have selected? This message is added to the string msg only when there is a post back.....

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 9th, 2003, 01:57 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jhock7
Default

Imar,

The example in the book does NOT have the postback check. I added it. Without it, "You have selected:" appears on the initial page.

Jeffrey A. Hock
 
Old December 9th, 2003, 04:19 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, I see. I thought you were trying to check your code.

I don't have the book, so I couldn't look at the example. From your original post it wasn't clear what you were asking.....

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8 style.aspx page stoverje BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 4 December 28th, 2010 04:22 AM
Where is the default.aspx in chapter 1? jkacher BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 February 29th, 2008 02:30 PM
Problems in Chapter 2 - Default.aspx nduckste BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 October 30th, 2006 11:50 PM
Chapter 2 datacontrol.aspx frogfur BOOK: Beginning ASP.NET 1.0 1 March 19th, 2005 12:59 PM
Chapter 1. Punctual.aspx dad62896 BOOK: Beginning ASP.NET 1.0 9 January 27th, 2004 01:11 PM





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