Last post May 23, 2011 09:18 PM by Decker Dong - MSFT
May 21, 2011 11:47 AM|r.zarei|LINK
Hi, i want to create a server control that has three control a FormView and two other control.
i want to reuses this control in multiples page, so i could assign FormViewa datasource, change it's itemtemplates via DESIGNER.
i know that their is 2 approaches:
1. a server control that extends FormView control
2. a composite control that has three control on it's control's collection.
I've test both approaches in the first approach i can't add the other controls to parent.controls collection because of the exception:
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.
in second approach i can't select datasource and edit itemtempleats of formview in my pages via designer.
tanks in advance.
May 23, 2011 02:57 AM|aswin_istq|LINK
if you want to use same formview in multiple pages. create a user control and add in multiple pages
May 23, 2011 09:18 PM|Decker Dong - MSFT|LINK
If you want to develop a Sserver-side control by just inherting from the FromView, it should work.
However, from your exception.... I want to see how you wrote your codes?
Would you mind showing them for me to see?