Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages by Jacob J. Sanford; ISBN: 9780470124482
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 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
  #1 (permalink)  
Old September 14th, 2011, 04:59 PM
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot convert type 'System.Web.UI.Page' to MasterPage'

In chapter 7, page 239.
I tried the code below in Visual Studio 2008
Code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
publicpartialclass_Default : System.Web.UI.Page
{
protectedvoid Page_PreInit(object sender, EventArgs e)
{
Page.MasterPageFile = "~/MasterPage.master";
}
protectedvoid Page_Load(object sender, EventArgs e)
{
MasterPage mp = (MasterPage)Page.Master;
mpLabel.Text = Master.myValue;
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
TextBox1.Text = "";
}
}
But there is an error
Code:
Cannot convert type 'System.Web.UI.Page' to MasterPage'
Thanks for help.


Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter two ...because it does not extend class 'System.Web.UI.Page' andres.gonzalez BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 4 September 25th, 2016 09:07 PM
Cannot implicitly convert type 'Login' to 'System.Web.UI.WebControls.Login' fh84 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 23rd, 2009 11:17 AM
Mobile Control in System.Web.UI.Page hpfarstad ASP.NET 2.0 Professional 0 August 28th, 2006 05:00 AM
Subclassing system.web.ui.page gazeth BOOK: ASP.NET Website Programming Problem-Design-Solution 2 May 25th, 2004 10:02 AM





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