Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
Password Reminder
Register
| FAQ | Members List | Calendar | 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 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 25th, 2004, 04:13 PM
Authorized User
 
Join Date: Jan 2004
Location: Raliegh, NC, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10 -- Using Cookies

Hi, I am trying to to run the code for Using Cookies on page 423 of Beginning ASP.NET 1.0.

Unfortunately, I am getting a an error that reads, CS1002: ; expected.
However, I am not missing a semi-colon. Any thoughts on what is causing the error?

Here is the code that I typed in and tried to run:

<%@ Page Language="C#" %>
<script Language="c#" runat="server">
void Page_Load(object source, EventArgs e)
{
if (!(IsPostBack))
{
MyButton.Text = "Save Cookie";
My DropDownList.Items.Add("Blue");
My DropDownList.Items.Add("Red");
My DropDownList.Items.Add("Gray");
}
}
public void Click(object sender, EventArgs e)
{
HttpCookie MyCookie = new HttpCookie("Background");
MyCookie.Value = MyDropDownList.SelectedItem.Text;
Response.Cookies.Add(MyCookie);
}
</script>
<html>
<body>

<form id="CookieForm" methods="post" runat="server">
<asp:DropDownList id="MyDropDownList" runat="server" />
<asp:button id="MyButton" runat="server" OnClick="Click" />
</form>

</body>
</html>

Thanks much,

-Michael

  #2 (permalink)  
Old January 25th, 2004, 04:43 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I think this is causing the error:

My DropDownList

I am sure you mean:

MyDropDownList

right?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old January 25th, 2004, 05:17 PM
Authorized User
 
Join Date: Jan 2004
Location: Raliegh, NC, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, that was problem!

I feel very silly now that I posted this in two separated forums!




 


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 10 gogeo BOOK: Beginning Access 2003 VBA 1 January 22nd, 2006 09:41 AM
Chapter 10 columbiasmiles JSP Basics 0 May 17th, 2004 08:09 PM
Chapter 10, Cookies McMug BOOK: Beginning ASP.NET 1.0 3 March 30th, 2004 04:03 AM



All times are GMT -4. The time now is 09:55 PM.


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