>>
>>Interesting. Does it mean I can do something like
>>
>>FormView frmRegular = (FormView) this.Page.FindControl("myFormViewName")
>>if ...
>
>Can you? Yes, it should work. However I wouldn't do an explicit cast and I wouldn't hardcode in the control name. If the control doesn't exist your code will throw an exception. Instead, something like:
>
>
>FormView regular = Page.FindControl(this.FormViewNameProperty) as FormView;
>
>if (regular != null)
>
>
>(you'd need to create a property in your user control, I'm using FormViewNameProperty as an example).
>
>You may also need to think about what happens when you've got multiple instances of the same user control on the form.
I only need to attach Client event if my FormName is a particular name (or I just add a property AttachGenderChange or something). I can not have multiple forms active at the same time and each form has only one GeneralInfo control.
If it's not broken, fix it until it is.
My Blog