I found a bug with the MyProfile.aspx.vb code. It failed to validate when I made changes. I could delete data from any of the fields and hit submit and it would save the blank fields. You would see the validation failure but only after it actually saved the data. The fix was to force a validation of the page just before the Page.IsValid check. Here is my code:
1
2 Protected Sub SaveButton_Click(ByVal sender As Object, ByVal e As EventArgs)
3 Page.Validate("CreateUserWizardControl")
4 Page.Validate("ChangeProfile")
5 If Page.IsValid Then
6 Profile.FirstName = Server.HtmlEncode(FirstNameTextBox.Text)
7 Profile.LastName = Server.HtmlEncode(LastNameTextBox.Text)
8 Profile.PCAId = Server.HtmlEncode(PCAId.Text)
9
10 Dim u As MembershipUser = Membership.GetUser()
11 u.Email = Server.HtmlEncode(EmailTextBox.Text)
12 Try
13 Membership.UpdateUser(u)
14 BackToMyAds()
15 Catch
16 EmailNotValid.Text = "This Email is in use or not allowed."
17 EmailNotValid.Visible = True
18 End Try
19 End If
20 End SubI have added the PCAId for my website so if you need to use this fix for yours, just paste lines 3 and 4 in before the If statement.
The Page.Validate function will make sure the validation is checked before allowing the page to be posted.