开发者

How can I automatically set a different ValidationGroup for each instance of a user control?

开发者 https://www.devze.com 2023-01-27 23:28 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消