Groups | Blog | Home
all groups > asp.net building controls > september 2004 >

asp.net building controls : Embeded Server Controls in a Custom Templated Control


James Hawes
9/28/2004 5:06:11 PM
I have created a templated control. As far as the control is concerned I am
able to put any HTML inside each template. However, I can't seem to figure
out how to embed a server control to it. When I compile and run it shows
up, but I can't wire up any kind of event to it. I have searched all over
the place for help. Could someone please point me in the right direction?

I'd be glad to post some code, but this control is copy-righted by the
company I work for, so I'll need to tweak it a little. I've also tried
touse the find control functions. This does find the control without
issue, however, I get a NullReference value exception when I try to add an
event to it, or even simply try to change the text. Essentially I want to
be able to add a button to one of my templates and then wire that button up.

Thanks,

James

James Hawes
9/29/2004 10:08:07 AM
I always try my best to respond when I find an answer. My issue was that
this control was initially an HTML control. I was overriding the Render
function. Once I commented out Render it worked fine.
I now have a seperate issue where I am creating some basic events to be
triggered. As a result of removing the Render I am unable to maintain
state.

James

[quoted text, click to view]

AddThis Social Bookmark Button