Using a Custom Server Control inside an ItemTemplate in DataList




When using templated columns in DataList, server controls can be
inserted. Rather than using the base server controls, I would like
to use one of my own custom server controls. Example: I have custom server
control that adds a rollover effect to the base Image control. Inside my
ItemTemplate I would like to use it rather than base image control. How do
this? Intellisense only shows me the base controls.


Tasos Vogiatzoglou

Ignore intellisense, add a reference of your control in the top,
something like

<%@ Register TagPrefix="cc1" Namespace="namespace of own control"
Assembly="assembly holding the control" %>

and then add the server control as usuall with <cc1:ComponentClass
runat="server" <other properties> />

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question