473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Learning ASP.NET 2.0 - Having trouble creating master page

It seems that if I put just html inside a master page, everything
works fine. But if I put other controls (such as WebControls and/or my
own custom controls), I can't seem to access the content area in the
designer (on the master page or the content page that uses the master
page). The designer is just greyed out completely. It does seem to
work at runttime, but this is a problem for usability. I must be doing
something wrong.

Here's a simple example that I've tried and couldn't get to work:

If I put this in the master page it works fine:

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="pm2.master.cs" Inherits="pm" %>
<%@ Register TagPrefix="CL" Namespace="CodeLib.Web.UI.WebControls"
Assembly="CodeLib.Web.UI.WebControls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0">
<form id="form1" runat="server">
<table>
<tr>
<td>
<asp:contentplaceholder id="contentMain" runat="server">
</asp:contentplaceholder>
</td>
</tr>
</table>
</form>
</body>
</html>

If I put this, it doesn't work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0">
<form id="form1" runat="server">
<asp:Table runat="server" id="tblMain">
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:contentplaceholder id="contentMain" runat="server">
</asp:contentplaceholder>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</body>
</html>

NOTE: The only difference is one uses an HTML table and the other uses
a WebControl table.

Any help would be appreciated.

Mar 29 '07 #1
2 1424
What exactly do you mean by " it doesn't work"

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Dave" <ch********@yahoo.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
It seems that if I put just html inside a master page, everything
works fine. But if I put other controls (such as WebControls and/or my
own custom controls), I can't seem to access the content area in the
designer (on the master page or the content page that uses the master
page). The designer is just greyed out completely. It does seem to
work at runttime, but this is a problem for usability. I must be doing
something wrong.

Here's a simple example that I've tried and couldn't get to work:

If I put this in the master page it works fine:

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="pm2.master.cs" Inherits="pm" %>
<%@ Register TagPrefix="CL" Namespace="CodeLib.Web.UI.WebControls"
Assembly="CodeLib.Web.UI.WebControls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0">
<form id="form1" runat="server">
<table>
<tr>
<td>
<asp:contentplaceholder id="contentMain" runat="server">
</asp:contentplaceholder>
</td>
</tr>
</table>
</form>
</body>
</html>

If I put this, it doesn't work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0">
<form id="form1" runat="server">
<asp:Table runat="server" id="tblMain">
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:contentplaceholder id="contentMain" runat="server">
</asp:contentplaceholder>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</body>
</html>

NOTE: The only difference is one uses an HTML table and the other uses
a WebControl table.

Any help would be appreciated.

Mar 29 '07 #2
Hello David Wier,

Thanks for your reply. The main problem is that I can't seem to use
the Visual Studio designer for drag and dropping into the content
area. If you take this sample code and stick it into a master page,
you'll see what I mean:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="margin:0">
<form id="form1" runat="server">
<asp:Table runat="server" id="tblMain">
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:contentplaceholder id="contentMain" runat="server">
</asp:contentplaceholder>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</body>
</html>

Both the master page and webpage that uses this master page doesn't
allow you to use the page at design time. However, if you change the
table webcontrols to hmtl, it works fine...

Is there something i'm missing here? I'm using Visual Studio 2005 w/
c#.

Thanks,
Dave

Mar 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: James | last post by:
I'm looking for some advice in teaching myself how to program. I just finished reading O'Reilly's Practical C++ Programing. I can do anything that was convered in the book very comfortably...
2
by: Jeremy S. | last post by:
I know these questions can have no objective and definitive/correct answer - but I'm looking for some general insight, non specific as it may be. So, from those of you who have actually worked...
5
by: Falc | last post by:
Hi there... I have been looking at learning Python, so far it looks like an absolutely grat language. I am having trouble finding some free resources to learn Python from. I am on windows and...
1
by: Friso Wiskerke | last post by:
Hi All, We've got an VS.2003 ASPNET (VB) webproject which we would like to convert to VS.2005 so that we can make use of the Master Page feature. Converting the initial pages to 2005 is not such...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
3
by: Pini | last post by:
Hi all,In asp.net 1.x i creates a basepage that extends System.Web.UI.Page class. I created this file in a web appplcaition project and then refernced it from another projects. All the pages in...
3
by: Jeff | last post by:
Hey! ASP.NET 2.0 I have a webpage which is based on a nested master page. The problem is that I've applied a theme to the webpage but the CSS settings isn't applied to the panes.... As you...
3
by: Bobby Edward | last post by:
I had a simple admin form for "Categories"... Details View: To INSERT new Category Grid View: To View, Edit and Delete all Categories I decided to put the INSERT Details View inside of a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.