 |
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
|
|
|
|
|

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

July 27th, 2012, 03:27 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

July 27th, 2012, 09:04 PM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks that work...But now I can't add a skin it is greyed out in the file extension
|
|

July 28th, 2012, 04:23 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

July 28th, 2012, 04:49 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

July 28th, 2012, 06:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

July 28th, 2012, 06:49 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes I have restarted, but in the book on page 230 when it asked me to select skin that is not there..
|
|

July 28th, 2012, 08:43 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

July 28th, 2012, 11:26 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

July 28th, 2012, 11:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |