Print Page | Close Window

Custom Web Control

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1852
Printed Date: 28 March 2026 at 4:29pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Custom Web Control
Posted By: CountAnton
Subject: Custom Web Control
Date Posted: 16 April 2003 at 6:24am

I want to create a custom web control that works a bit like the Repeater Control, so I can define template details...

<myPrefix:myRepeater etc...>

<title>

Specific Group of Links

</title>

<ItemTemplate>

<a href="<%# DataBinder.Eval(Container.DataItem, "url_field")%>"> <%# DataBinder.Eval(Container.DataItem, "link_name_field" %></a><%# DataBinder.Eval(Container.DataItem, "iwg_displayed_name") %>

</ItemTemplate>

</myPrefix:myRepeater>

but so far all the custom control examples I've found are for single tag custom controls like...

<myPrefix:myControl etc... />

I'm going to play around with inheriting from Repeater to see if that gets me anywhere, but thought I'd post here in case someone knows about this...



-------------
Anton Channing
http://www.kiamagic.com



Replies:
Posted By: CountAnton
Date Posted: 16 April 2003 at 6:50am

Hmm, I seem to have found something...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomizingcontrolswithtemplates.asp - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomizingcontrolswithtemplates.asp

...might just be what I'm looking for.  Sorry to answer my own question but there you have it!



-------------
Anton Channing
http://www.kiamagic.com


Posted By: CountAnton
Date Posted: 23 April 2003 at 3:02am

Well, the above example worked fine, but...

Getting a bit more advanced now, I think what I actually need is a Custom Templated Databound Control, but the article on msdn for this is very obscure and difficult to follow...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontemplateddataboundcontrolsample.asp - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontemplateddataboundcontrolsample.asp

So I'm looking for something that describes it in easier to follow steps.  If found a page with a link to an article, but the link seems to be broken...

http://www.aspalliance.com/aspxtreme/webforms/controls/keyconceptsinwebformscontroldevelopment.aspx - http://www.aspalliance.com/aspxtreme/webforms/controls/keyconceptsinwebformscontroldevelopment.aspx

...So any help would be appreciated.



-------------
Anton Channing
http://www.kiamagic.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net