Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old May 27th, 2004, 03:54 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10 Navigator.aspx problem

Hi,

I am working on the Try it Out example - Navigator.aspx. Following is the code I copied from the book:

<%@ page Language="c#" %>

<script Language="c#" runat="server">

void Page_Load(object source, EventArgs e)
{
    if (!IsPostBack)
    {
        MyButton.Text = "OK";
        MyDropDownList.Items.Add("http://www.microsoft.com");
        MyDropDownList.Items.Add("http://www.wrox.com");
        MyDropDownList.Items.Add("http://msdn.microsoft.com");
    }
}
</script>

<html>
<body>
    <form id="WebForm1" method="post" runat="server">
        <asp:DropDownList ID=MyDropDownList runat="server" />
        <asp:button ID=MyButton runat="server" Text="" />
    </form>
</body>
</html>

When I open it from the browser I should see the button with 'OK' and the three urls in the dropdown list. But that's not happening. I can't see anything. If I take away the '!' mark from
if (!(IsPostBack)) statement [which is [if (IsPostBack)], I can see the button with 'OK' and the 3 urls. If I click the OK button it will add another 3 urls to the dropdown list. Could anybody tell what is going on here. Thanks a lot.



Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 10 problem nikItas BOOK: Beginning Access 2003 VBA 1 August 5th, 2008 08:54 AM
Chapter 10 problem rstoos Beginning PHP 1 September 16th, 2006 01:14 PM
Chapter 10 login problem Dennis Mollet BOOK: Beginning VB.NET Databases 1 August 18th, 2005 04:07 AM





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