Issue:
If you put the Login control in a content page, you are using master pages, and then try to use the
ValidationSummary control to display the summary of validator errors the
ValidationSummary control doesn't render the errors as you might expect to.
Reason:By default the validator controls in the
Login control assign their
ValidationGroup to the
UniqueID of the
Login control. When hosting the
Login control in a content page, the
UniqueID of the
Login control is not simply the ID you assigned in your aspx markup. The
UniqueID is resolved using the naming container. The problem arises when you attempt to set the
ValidationGroup of the
ValidationSummary control. You can't simply set it to the ID you assigned for the
Login control in your aspx markup, you must set it to the
UniqueID of the
Login control. This is the ID that is rendered in the HTML output and used by the validator Javascript associated with the validators inside the
Login control.
Solution:In
Page_Load add a line such as this...
ValidationSummary1.ValidationGroup = Login1.UniqueID;
Note:If you are using a templated user control, you can set the
ValidationGroup of the validator controls in your aspx markup and also set the corresponding
ValidationGroup of the
ValidationSummary control to that same ID. The naming container is not involved, with regards to the
ValidatorGroup, in this case. The
ValidationGroup is assigned the ID specified in the templated markup in your aspx page.
Hope this helps