View Single Post
  #1 (permalink)  
Old August 21st, 2014, 09:43 PM
JeffPalley JeffPalley is offline
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error in Chapter 3 Code or in my head?

I wouldn't write you except that I've been going over this code for three days. It matches every diddle and dot in the book example, but guess what: the panel doesn't appear when the checkbox is checked. (Yes, the checkbox's AutoPostback="true"). It's impossible for me to believe that nonfunctional code would have made it this far without being caught, but I've also gone over and over the code and everything (everything that I understand at least) seems perfect: the Protected Sub CheckBox1_CheckedChanged seems to run, but still ... no panel appears. Normally, I would not bother you with a problem like this, but it's *so* "clearly" the same code as in the book; yet it doesn't run. I'd really appreciate you having a look at it. Thanks, -Jeff

Code:
 Container.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Container.aspx.vb" Inherits="Container" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" Text="Show Panel" />
 
      <asp:Panel ID="Panel1" runat="server" visible="false">
         I am visible now.
      </asp:Panel>

  </div> 
  </form>
</body>
</html>

-- Container.aspx.vb --

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Container.aspx.vb" Inherits="Container" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" Text="Show Panel" />
 
      <asp:Panel ID="Panel1" runat="server" visible="false">
         I am visible now.
      </asp:Panel>

  </div> 
  </form>
</body>
</html>
Reply With Quote