ASP.NET Template Management hides content from a page

I am writing my own Modal Popup as a templating control in ASP.NET. I have two template containers, one for the title of the window and one for the actual control that I want to display in the modal window (let's call this a form control). Form controls can contain server controls like buttons, text boxes, etc.

This works well except when I want to access a form control on my web page. My code won't recognize content in a template control - just like it won't, say, a relay. So I figured the control panel works the same as what I want, except that the Panel control has only "one container" and I would really like to be able to set both the title and the content (control form).

I figured I could overwrite the Panel control to add my own html, but that would limit my title to something encoded in the attribute. So is it really better to actually show the title as just a property rather than a template, and therefore limit what I can write for the title?

0


source to share


2 answers


I ended up redefining the Panel control, recognizing that I can only "pass" one set of controls as my children. Also I had to make the title of the property, which I set as an attribute in the modalpopup control.



Even though I couldn't solve it the way I wanted, I think the solution is good enough.

0


source


As you can with a relayer, try using the ParentControl.FindControl (...) method to get the control you want.



0


source







All Articles