Wrox Programmer Forums
|
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 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 July 27th, 2012, 03:12 PM
Registered User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6

Hi I get error message that says that 1stpreferredTheme is not a valid identifier when I actually followed what the book told me to do. It is on page 223 224. This is driving me crazy because I cant go foward to the next chapter until this is fixed, and the semester is almst over.'
Here is what my code looks like. Since I did this code i have several errors
Partial Class FirstPreferredTheme
Inherits System.Web.UI.MasterPage

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles 1stPreferredTheme.SelectedIndexChanged
Dim preferredTheme As HttpCookie = New HttpCookie("PreferredTheme")
preferredTheme.Expires = DateTime.Now.AddMonths(3)
preferredTheme.Value = 1stPreferredTheme.SelectedValue
Response.Cookies.Add(preferredTheme)
Response.Redirect(Request.Url.ToString())
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim selectedTheme As String = Page.Theme
Dim preferredTheme As HttpCookie = Request.Cookies.Get("PreferredTheme")
If preferredTheme IsNot Nothing Then
selectedTheme = preferredTheme.Value
End If
If 1stPreferredTheme.Items.FindByValue(selectedTheme) IsNot Nothing Then
1stPreferredTheme.Items.FindByValue(selectedTheme) .Selected = True
End If
End If
End Sub
End Class
 
Old July 27th, 2012, 03: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

Hi there,

It's not 1stPreferredTheme as in first but lstPreferredTheme as in list. In other words, the first character needs to be a lower case L, not the number 1.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 27th, 2012, 09:04 PM
Registered User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks that work...But now I can't add a skin it is greyed out in the file extension
 
Old July 28th, 2012, 04:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Not sure I understand what you mean with "it is greyed out in the file extension". Can you describe the problem in more detail?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 28th, 2012, 04:49 AM
Registered User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have to create a skin file and when I go to tools options and click file extension in the text editor catagory, I am unable to type skin and click add button(that is what is greyed out) I am asumming thats because I cant add create skin file. It is on the bottome of page 229 in chapter 6
 
Old July 28th, 2012, 06:31 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I am unable to type skin and click add button(that is what is greyed out)
That's odd. Have you tried restarting Visual Studio?

Note: that part is optional. Associating the skin file with the UC editor gives you IntelliSense when editing Skins. However, you can safely skip that step and just manually create the Skin files, or create the code in a User Control or Page and then copy and paste it in the Skin file. If you do that, don't forget to remove the ID attribute.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 28th, 2012, 06:49 AM
Registered User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I have restarted, but in the book on page 230 when it asked me to select skin that is not there..
 
Old July 28th, 2012, 08:43 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think there's some confusion about what you should do.

1. Page 229 enables you to link the .skin extension to the User Control editor. This is an optional exercise and is only used to get IntelliSense in the Skin files which is not a requirement, Is it there where the button is disabled?

2. The exercise on page 230 shows you how to create a Skin file using the Add New Item dialog. You have to rigth-click the Monochrome folder or the Skin file won't show up. Is is there where you can't find the item and click Add?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 28th, 2012, 11:26 AM
Registered User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's exactly what I am doing clicking on the monochrome folder add new item, and where it tells me to select skin file type its not there. I dont see that the only thing that shows is mybasepage. I am following what is says on 230
 
Old July 28th, 2012, 11:47 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That's really odd. Can you upload a full screenshot somewhere showing your copy of Visual Studio with the Solution Explorer visible and the Add New Item dialog on top of it?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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