views:

51

answers:

1

When the Login Control is used with MasterPages, the ValidationSummary does not show the validation messages. I have set the ValidationGroup property to the ID of the Login control.

I tried using the approach at Link with no luck.

Thanks

A: 

Try

ValidationSummary1.ValidationGroup = Login1.ClientID;
or
ValidationSummary1.ValidationGroup = Login1.UniqueID;

Please note that if you choose to customize the Layout Template of this control in your aspx page, you should just manually set the validation group of the validators yourself.

Such as:

<asp:RequiredFieldValidator ID="UserNameRequired" ValidationGroup="Login1" />

and in the code-behind:

protected void Page_Load( object sender, EventArgs e )
{
    ValidationSummary1.ValidationGroup = "Login1";
}
Greg
Neither work :( Yes, I have customized the layout. Should I set the validation group of all the validators to Login1.ClientID?
Just set them both to the same thing, and you'll be fine. Please see my edit for an example.
Greg
Excellent! that works like a charm!