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
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.


<%@ 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 ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
    <uc1:ContactForm ID="ContactForm1" runat="server" />

error is: Element ContactForm is not a known element.

Can anyone figure this out?


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?


Arya December 20th, 2009 07:31 AM

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.


All times are GMT -4. The time now is 01:56 AM.

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