Web User Control in Content page - Urgent; PLease help
-
Dear All, I am adding an ascx file into a content page and always I receive an unknown element error. Somehow In content page eventhough I register the ascx file, the control seems to be not known or recognized. Why do you think it happens? Here is my html code - do I miss something? <%@ Page Language="C#" MasterPageFile="~/MAIN.Master" AutoEventWireup="true" CodeBehind="Urunler.aspx.cs" Inherits="cicektablo.Urunler" Title="flowerbox® Türkiye" %> <%@ Register src="WebMessageBox.ascx" tagname="WebMessageBox" tagprefix="uc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server"> <uc1:WebMessageBox ID="WebMessageBox1" runat="server" /> </asp:Content> ps: I also checked the msdn and it is explianed in excatly my way. I do not understand.
-
Dear All, I am adding an ascx file into a content page and always I receive an unknown element error. Somehow In content page eventhough I register the ascx file, the control seems to be not known or recognized. Why do you think it happens? Here is my html code - do I miss something? <%@ Page Language="C#" MasterPageFile="~/MAIN.Master" AutoEventWireup="true" CodeBehind="Urunler.aspx.cs" Inherits="cicektablo.Urunler" Title="flowerbox® Türkiye" %> <%@ Register src="WebMessageBox.ascx" tagname="WebMessageBox" tagprefix="uc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server"> <uc1:WebMessageBox ID="WebMessageBox1" runat="server" /> </asp:Content> ps: I also checked the msdn and it is explianed in excatly my way. I do not understand.
If you need help with a specific error you should always give the exact text of the error message. Is the user control in the same folder as the page? Did you try adding the user control by dragging and dropping into the design of the page or did you add it manually through in the aspx?
-
If you need help with a specific error you should always give the exact text of the error message. Is the user control in the same folder as the page? Did you try adding the user control by dragging and dropping into the design of the page or did you add it manually through in the aspx?
Thanks a lot for the answer it says webmessagebox(web user control) is not a known element... yes I tried dragging and dropping it... even so it gives the same error.
-
Thanks a lot for the answer it says webmessagebox(web user control) is not a known element... yes I tried dragging and dropping it... even so it gives the same error.
Here are a few things to try in whatever order you choose: Make sure your control is in the same namespace as your pages or specify namespace in references. Under the Build menu, Clean Solution, then rebuild. Remove the control from the project completely, build, add it back and build again. Create a new project file and add the pages and controls into it.