How can I automatically set a different ValidationGroup for each instance of a user control?
I have a user control that has multiple instances on a single page.
Is it poss开发者_运维知识库ible to have each instance use a unique ValidationGroup? I could expose a property, but I'm wondering if there's any way to do it automatically.
No automatic way; you have to include a public ValidationGroup property in the user control code-behind, and assign that to every control in the UC. This could be programmatic assignment, but it also might work in markup using a <%= %> approach, not 100% sure about that.
HTH.
精彩评论