Server Control help? Code attached
-
I'm trying to create a basic server control to display and image but i keep getting errors. The control code below compiles fine but when i try to add it to a page it gives me errors. Can anyone help? Control code: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="testControl.ascx.cs" Inherits="_Default"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <img src="booze.jpg" runat="server" id="image" /> <br /> Code used in page/web form: <%@ Register TagPrefix="apress" TagName="image" Src="testControl.ascx" %> <apress:image id="image1" runat="server"></apress:image> I've added the control .dll to the project and everything but i still get errors. Help???
-
I'm trying to create a basic server control to display and image but i keep getting errors. The control code below compiles fine but when i try to add it to a page it gives me errors. Can anyone help? Control code: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="testControl.ascx.cs" Inherits="_Default"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <img src="booze.jpg" runat="server" id="image" /> <br /> Code used in page/web form: <%@ Register TagPrefix="apress" TagName="image" Src="testControl.ascx" %> <apress:image id="image1" runat="server"></apress:image> I've added the control .dll to the project and everything but i still get errors. Help???
windhopper wrote:
I've added the control .dll to the project
why? i think you are trying to create a UserControl , then why dll ?
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
-
windhopper wrote:
I've added the control .dll to the project
why? i think you are trying to create a UserControl , then why dll ?
Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"
Yes i am trying to create a user control but i keep getting errors when i add the control like i described so i've tried with the control .dll and without and still get errors so i'm looking for suggestions as to what else i can try? Is there something wrong with my code even though it compiles?