Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
I created one new samlpe.asp page
C#
<%@Page Title="" Language="C#" ......%>
<asp:Content ID="content1" ContentPlaceHolderID="HeadContent" Runat="Server></asp:Content>
<asp:Content ID="content1" ContentPlaceHolderID="MainContent" Runat="Server></asp:Content>


In this page I want to use Html Form tag with Splitter
Ex:
C#
<html>
<head id=id1" reunat="server">
<style type="text/css">
----
----
</style>
</head>
<body>
<obspl:splitter ---> </obspl:splitter>
</body></html>

Error:Only Content controls are allowed directly in a content page that contains content controls


Please tell me how to use html tag in "sample.asp" page

Thanks.
Posted
Updated 6-Jul-12 5:40am
v2

1 solution

Hi,

It seems you're using a master page.

You should wrap all your controls inside your ContentPlaceHolder. No html tags inside, they should be in the master page.

Otherwise don't use any ContentPlaceHolder neither a masterpage.

Have a look at this: Multiple ContentPlaceHolders and Default Content (C#)[^]

Hope it helps.
 
Share this answer
 
Comments
myansweris 6-Jul-12 11:48am    
Thank you for reply ...
FYI ... I just want to add a sample.asp page to my Project,yes this page contains Master Page too .. to get headers.
_Zorro_ 6-Jul-12 11:58am    
What header? html header? Why do you need a master page? Can't you just not reference it if you really need specific html tags inside that specific page?

Otherwise you will need to put all your common html tags inside the masterpage and only specific code inside the ContentPlaceHolder.

Also, check google on how to use master pages and when they're needed.
myansweris 6-Jul-12 12:08pm    
Ok ... i remove the Master page & Executed now working.But how to use this page(sample.aspx)in my Project with Master page contents?
_Zorro_ 6-Jul-12 12:16pm    
You really should take a look at some tutorial on how to use master pages.
If you really need a master page, you will need to strip all the html tags and place only the content inside the ContentPlaceHolder. You can't have any html tags inside.

In the master you will have something like:
<html>
<head>
<asp:ContentPlaceHolder ID="HeadContent" runat="server" />
</head>
<body>
<asp:ContentPlaceHolder ID="BodyContent" runat="server" />
</body>
</html>

And inside your page you should have something like:
<asp:Content ID="uxContentHeader" runat="server" ContentPlaceHolderID="HeaderContent">Content
<asp:Content ID="uxContentBody" runat="server" ContentPlaceHolderID="BodyContent">Content
myansweris 6-Jul-12 12:17pm    
Ok thank you somuch ....I will work on that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900