开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜