Click to See Complete Forum and Search --> : Server Controls - Please Help!
windhopper
June 19th, 2008, 08:19 AM
I'm using VS 2005 on .Net 2.0 and need to create 2 server controls in C#. The one needs to display an image and the other a video and they need to be able to have associated properties. Is that possible?
Can anyone offer me some advice on where to start or have any code that can help me find my way?
Much appreciated.
hspc
June 20th, 2008, 10:46 AM
You should have a look on:
Developing ASP.NET Server Controls (http://msdn.microsoft.com/en-us/library/aa719973%28VS.71%29.aspx) and Building ASP.NET User and Server Controls (http://www.15seconds.com/issue/020319.htm)
windhopper
June 23rd, 2008, 04:13 AM
Thanks, i've tried there but i still get errors when i include it in my web form.
Below is the code i've used:
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>
Can you make any suggestions as to what i can do cause the control compiles fine and so did the web page before i added the control?
Thanks
hspc
June 24th, 2008, 02:25 PM
What is the error message that you get?
I suspect that this part is not right: Inherits="_Default"
The control does not inherit from the _Default class, should it be testControl ?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.