Last post Aug 30, 2009 10:44 PM by Allen Chen – MSFT
Aug 26, 2009 09:33 AM|slayer35|LINK
Hi , I want to pass the page's server controls(especially gridviews,datalists,repeaters) as parameter to my custom server control. My purpose is to make a html to pdf export button as a custom server control.
Programmer will add the my custom control to a page and select the control from the usercontrol properties which he/she wants to make a pdf output.And button inside the user control will export selected control as pdf document
like ajax toolkit controls,forexample textboxwatermark extender ,you add a textboxwatermarkextender to page and select targetcontrolID.That's what I want to do,select a control from the page, for my custom control
(note:html to pdf conversion are done only this part is missing)
Any help is appreciated,thanks
server control designer properties skmMenu
Aug 28, 2009 04:53 AM|Allen Chen – MSFT|LINK
You can expose a public string property that accept control ID. You can get the reference of the Page via Page property. Then use Control.FindControl() method to get the reference of the control.
Aug 28, 2009 08:13 PM|slayer35|LINK
thanks for your concern,I've already can do what you said,but I'am looking for better solution to this problem.I want to limit programmer to select the control from the page as targetcontrol,like ajaxtoolkit components.
Aug 30, 2009 10:44 PM|Allen Chen – MSFT|LINK
Do you mean you want to get a design time support that pops up a Extender Wizard window for any control? If so you can refer to the source code of AJAX Toolkit. There're a lot of Extender controls in it. Basically what you need to do is to inherit ExtenderControlBase,
and add a custom designer if you want:
public class MyExtender : ExtenderControlBase
You can also refer to this article to get more details as to how to achieve that: