p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 (http://p2p.wrox.com/forumdisplay.php?f=389)
-   -   Chapter 9: Element[user control] is not a known element (http://p2p.wrox.com/showthread.php?t=77515)

Arya December 20th, 2009 07:09 AM

Chapter 9: Element[user control] is not a known element
 
Hi,
I am working on try it out on page 294. I did everything as described, but when i drag user control from solution explorer to the ContactForm.aspx page i get a following error.

Code:

<%@ Page Title="Contact Us" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Contact.aspx.cs" Inherits="Contact" %>

<%@ Register src="../Controls/ContactForm.ascx" tagname="ContactForm" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
  <p>
    <uc1:ContactForm ID="ContactForm1" runat="server" />
  </p>
</asp:Content>

error is: Element ContactForm is not a known element.

Can anyone figure this out?

Arya

Imar December 20th, 2009 07:28 AM

Hi Arya,

Are you sure the User Control / the entire site is error free? Try the Build | Rebuild Web Site menu and then look at the Error List window. Do you see anything there?

Imar

Arya December 20th, 2009 07:31 AM

Hi,
I was a bit hasty, i found the solution to this error.

There was an error in code behind of the ascx page. Class name was slightly different from the Inherits attribute. That correction solved an error.

Arya


All times are GMT -4. The time now is 09:23 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.