Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 23rd, 2010, 09:15 AM
Authorized User
 
Join Date: Jul 2010
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default Chap4: Error creating control

Hi

i don't why but my master page can not view the menutabs and menutree controls in the table cells.

at the top of the page there is the following command:

<%@ Register Assembly="A1.FrameworkControls" Namespace="A1.FrameworkControls" TagPrefix="ctrl" %>

the controls are there in the A1.FrameworkControls.

in the page at the following tags:

<td>
<ctrl:MenuTabs ID = "MenuTabs" runat="server" />
</td>

the MenuTabs is underlined with a green line saying that the element is not known.

I am using Visual studio 2010 and i am wondering if there is a difference with the 2008 for loading the server controls.

in the master page code the Menutabs and MenuTree do not exist.

here is the code:

using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using A1.Business_Logic_layer.Framework;

public partial class EAD : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
ENTUserAccountEO currentUser = ((BasePage)Page).CurrentUser;

//Set the top menu properties
MenuTabs.MenuItems = Globals.GetMenuItems(this.Cache);
MenuTabs.RootPath = BasePage.RootPath(Context);
MenuTabs.CurrentMenuItemName = ((BasePage)Page).MenuItemName();
MenuTabs.UserAccount = currentUser;

//Set the side menu properties
MenuTree.MenuItems = Globals.GetMenuItems(this.Cache);
MenuTree.RootPath = BasePage.RootPath(Context);
MenuTree.CurrentMenuItemName = ((BasePage)Page).MenuItemName();
MenuTree.UserAccount = currentUser;

lblCurrentUser.Text = Page.User.Identity.Name;
lblCurrentDateTime.Text = DateTime.Now.ToString();

//Set the version
lblVersion.Text = ConfigurationManager.AppSettings["version"].ToString();
}
}

The methods are seen correctly but the menuTabs and MenuTree are underlined with a red line saying that these names do not exist in the current context.

Can someone help me please to solve this issue?

Thank you
 
Old July 23rd, 2010, 10:58 AM
Authorized User
 
Join Date: Jul 2010
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Cool Problem solved

In VS 2010

to view the controls in the page the code is the following:

<ctrl:ServerControl1 ID="Controlname" runat="server" />

keep posting Guys





Similar Threads
Thread Thread Starter Forum Replies Last Post
SignGuestbook.ascx: Error Creating Control - pnlSignGuestbook gvdamn BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 2 August 20th, 2009 05:43 AM
Creating a new control Bhattachan ASP.NET 2.0 Basics 0 August 12th, 2007 11:07 AM
creating com control ojemuyiwa Classic ASP Components 0 August 31st, 2005 05:17 AM
Re-Creating User Control chiefouko General .NET 2 April 12th, 2004 02:26 AM
Creating control acko ASP.NET 1.x and 2.0 Application Design 2 November 13th, 2003 08:34 AM





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