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

H

hazz

putting a custom control in an aspx page that inherits from a master page is
not working out for me. Any tips after getting that error?
Also Element 'Search' is not a known element. This can occur if there is a
compilation error in the Web site.

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search"
Title="Untitled Page" %>
<%@ Register TagPrefix="uc" TagName="Search"
Src="~\Controls\column_search_filter.ascx" %>

<html>
<body>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<uc:Search id="Search1"
runat="server" />
</asp:Content>
</body>
</html>


Thank you,
-Greg
 
S

Swanand Mokashi

Where are you seeing the error ? in the aspx page runtime or compiler error

I am not sure if it is a problem, but might be worth change the Src to
Src="~/Controls/column_search_filter.ascx" (/ instead of \)

HTH

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top