Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 February 7th, 2011, 05:53 PM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 - pg.228 ThemeList "not declared"

I'm having a problem with the "list" function when I type the line "preferredTheme.Value = ThemeList.SelectedValue" VWD 2010 says "ThemeList is not declared..."

This is particularly important because it's holding up development on an actual application I'm writing for work. In that case I have the same problem with the
"ViewListItems". What am I missing something?... other than just about everything... I'm less than a beginner.

Thanking you in advance... Lee
 
Old February 7th, 2011, 05:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

As I said in my personal e-mail on the same subject:

Quote:
Also, please post the relevant code so it's easier to see what the problem is.
Cheers,

Imar

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

Author of Beginning ASP.NET 4 : in C# and VB, Beginning ASP.NET 3.5 : in C# and VB and ASP.NET 2.0 Instant Results.
While typing this post, I was listening to: Man Next Door by Massive Attack (Track 7 from the album: Mezzanine) What's This?
 
Old February 7th, 2011, 06:40 PM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Relevant Code

Imar,

Well there really isn't much other than what I posted... your example on Pg. 228 is as follows:

In the selectedIndexChanged event for the DDL per the exercise


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

I can't access the "ThemeList.SelectedValue" method Intellisense doesn't contain "ThemeList" and the error VWD 2010 throws is "ThemeList is not declared, it may be inaccessible due to it's protection level"

nuts... I just closed the BegASPNET/Wrox VWD app and now it I don't get an error. I say nuts because I was hoping that this was going to help me pinpoint the problem with my work app that I'm developing where I get a similar error but with the Listitem method... i guess I need to post that separately.

Where might I do that? I need to get a data item in code behind from a listview.

Thanks again for your super help.
 
Old February 8th, 2011, 03:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Maybe Visual Studio hadn't picked up the changes in the Markup yet? When you run into issue like this, try compiling the site using Build | Build Web Site or Build SOlution.

The reason I asked for more code is the fact that the control you're targeting is defined in the markup. If you gave it a different name,such us lstThemes, it explains why IntelliSense couldn't find it.

Quote:
Where might I do that? I need to get a data item in code behind from a listview
Best place is in one of the general, non-book specific forums here: http://p2p.wrox.com/asp-net-4-539/

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Error:"msoControlPopup is not declared" when i write an addin for Excel in VB2008 Waterharbin Visual Basic 2008 Essentials 0 September 23rd, 2010 09:10 AM
Error:"msoControlPopup is not declared" when i write an addin for Excel Waterharbin Excel VBA 0 September 23rd, 2010 09:06 AM
Labels etc on ascx page "Not Declared" Wozer BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 2 January 22nd, 2010 04:28 PM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM





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