Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 3.5 SP1 Edition: In C# and VB by Bill Evjen, Scott Hanselman, and Devin Rader; ISBN: 9780470478264
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 SP1 Edition: 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 June 5th, 2009, 08:56 AM
Registered User
 
Join Date: Apr 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default On page 799 the code doesn't seem to work?

Quote:

protected
void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
WebParts.WebPartdisplayMode wpDisplayMode= WebPartManager1.SupportedDisplayModes[DropDownList1.SelectedValue.ToString()];
WebPartManager1.DisplayMode = wpDisplayMode;
}

protectedvoid Page_Init(object sender, EventArgs e)
{
foreach (WebPartDisplayMode wpMode in WebPartManager1.SupportedDisplayModes)
{
string modeName = wpMode.Name;
ListItem dd_ListItem = newListItem(modeName, modeName);
DropDownList1.Items.Add(dd_ListItem);
}
}
I get an compiler error on " WebParts" -->
Error 2 The type or namespace name 'WebParts' could not be found (are you missing a using directive or an assembly reference?) C:\..\Visual Studio 2008\WebSites\..\MasterPage.master 11 13 C:\...\..\

Is it I do or is there something wrong in the code?

Thx.
 
Old June 5th, 2009, 09:41 AM
Registered User
 
Join Date: Apr 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is it possible that WebParts must be WebPartDisplayMode?
 
Old June 22nd, 2009, 09:09 AM
Registered User
 
Join Date: Apr 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To bad nobody gives me a reaction.
 
Old July 9th, 2009, 06:01 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Same issue.. D code does'nt work

I am getting d same sort of errors as you are..
Any breakthrough???
Do reply
 
Old July 9th, 2009, 06:11 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default D reason

The reason 4 my errors was the square brackets...
but they seem to be correct in your code..
Itz working fine..
try again





Similar Threads
Thread Thread Starter Forum Replies Last Post
why this code does not work ? sandeepgreaternoida BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 April 12th, 2009 04:48 PM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
code does not work keithschm Beginning PHP 5 January 10th, 2005 09:52 AM
Code from Book did not work! mnongkhlaw Classic ASP Databases 0 October 27th, 2003 07:30 AM





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