I would like to ask one more thing about
MembershipEditor_AccountCreating event.
Let us assume that we want two additional profile fields stored another profile related table. Let's call them as HairColor and EyeColor. In the MemberShipEditor module I've added these two extra fields.
aspx part;
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MembershipEditor.ascx.cs" Inherits="ProjectName.Web.prDene.WebParts.MembershipEditor" %>
<%@ Import Namespace="MonoSoftware.MonoX.Resources"%>
<%@ Register TagPrefix="MonoX" TagName="StyledButton" Src="/MonoX/controls/StyledButton.ascx" %>
<
div
class
=
"membership-module-container input-form"
style
=
""
>
<
div
id
=
"Div1"
runat
=
"server"
>
<
asp:ValidationSummary
ID
=
"validationSummary"
CssClass
=
"validation-summary"
runat
=
"server"
/>
</
div
>
<
div
class
=
"register"
>
<
h2
><%= Page.User.Identity.IsAuthenticated ? DefaultResources.MembershipEditor_Title_UpdateAccount : DefaultResources.MembershipEditor_Title_CreateAccount %></
h2
>
<
dl
>
<
dd
>
<
label
for="<%= txtUserName.ClientID %>"><%= DefaultResources.MembershipEditor_UserName %></
label
>
<
asp:Label
ID
=
"lblUserName"
runat
=
"server"
></
asp:Label
>
<
asp:TextBox
ID
=
"txtUserName"
runat
=
"server"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"vldRequiredUserName"
runat
=
"server"
ControlToValidate
=
"txtUserName"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
<
asp:CustomValidator
ID
=
"vldCustomUserName"
runat
=
"server"
ControlToValidate
=
"txtUserName"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
</
dd
>
<
dd
>
<
label
for="<%= txtPassword.ClientID %>"><%= DefaultResources.MembershipEditor_Password %></
label
>
<
asp:TextBox
ID
=
"txtPassword"
runat
=
"server"
TextMode
=
"Password"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"vldRequiredPassword"
runat
=
"server"
ControlToValidate
=
"txtPassword"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
</
dd
>
<
dd
>
<
label
for="<%= txtRepeatPassword.ClientID %>"><%= DefaultResources.MembershipEditor_RepeatPassword %></
label
>
<
asp:TextBox
ID
=
"txtRepeatPassword"
runat
=
"server"
TextMode
=
"Password"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"vldRequiredRepeatPassword"
runat
=
"server"
ControlToValidate
=
"txtRepeatPassword"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
<
asp:CompareValidator
ID
=
"vldCompareRepeatPassword"
runat
=
"server"
ControlToValidate
=
"txtRepeatPassword"
Text
=
"!"
SetFocusOnError
=
"true"
ControlToCompare
=
"txtPassword"
Operator
=
"Equal"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
></
asp:CompareValidator
>
</
dd
>
<
dd
>
<
label
for="<%= txtEmail.ClientID %>"><%= DefaultResources.MembershipEditor_Email %></
label
>
<
asp:TextBox
ID
=
"txtEmail"
runat
=
"server"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"vldRequiredEmail"
runat
=
"server"
ControlToValidate
=
"txtEmail"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
<
asp:RegularExpressionValidator
ID
=
"vldRegexEmail"
runat
=
"server"
ControlToValidate
=
"txtEmail"
Text
=
"!"
SetFocusOnError
=
"true"
CssClass
=
"validator ValidatorAdapter"
Display
=
"Dynamic"
/>
</
dd
>
<
dd
>
<
label
>Hair Color</
label
>
<
asp:TextBox
ID
=
"txtHairColor"
runat
=
"server"
></
asp:TextBox
>
</
dd
>
<
dd
>
<
label
>Eye Color</
label
>
<
asp:TextBox
ID
=
"txtEyeColor"
runat
=
"server"
></
asp:TextBox
>
</
dd
>
<
asp:PlaceHolder
ID
=
"plhRememberMe"
runat
=
"server"
>
<
dd
>
<
label
> </
label
>
<
asp:CheckBox
ID
=
"chkRememberMe"
runat
=
"server"
style
=
"float: left;"
/>
<
label
style
=
"margin-top: 2px; float: left;"
for="<%= chkRememberMe.ClientID %>"><%= DefaultResources.MembershipEditor_RememberMe %></
label
>
</
dd
>
</
asp:PlaceHolder
>
<
dd
>
<
asp:Label
ID
=
"labInfo"
runat
=
"server"
></
asp:Label
>
</
dd
>
</
dl
>
<
div
class
=
"input-form"
>
<
div
class
=
"button-holder"
style
=
"float: right;"
>
<
MonoX:StyledButton
ID
=
"btnCreateAccount"
runat
=
"server"
CssClass
=
"CssFormButton"
Text
=
"Create"
></
MonoX:StyledButton
>
<
MonoX:StyledButton
ID
=
"btnUpdateAccount"
runat
=
"server"
CssClass
=
"CssFormButton"
Text
=
"Update"
Visible
=
"false"
></
MonoX:StyledButton
>
</
div
>
</
div
>
</
div
>
</
div
>
and the codebehind file:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
MonoSoftware.MonoX;
using
MonoSoftware.MonoX.ModuleGallery;
namespace
ProjectName.Web.prDene.WebParts
{
public
partial
class
MembershipEditor :MonoSoftware.MonoX.ModuleGallery.MembershipEditor
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
void
MembershipEditor_AccountCreating(
object
sender, MembershipModuleEventArgs e)
{
int
a = 456;
}
void
MembershipEditor_AccountCreated(
object
sender, MembershipModuleEventArgs e)
{
int
a = 456;
}
}
}
According to the note given on this forum, I've made my class inherited from "MonoSoftware.MonoX.ModuleGallery.MembershipEditor". But the problem is I can't the break the code while running on 'int a = 456;' lines.
How could I catch these special events in order to insert the additional profile felds to related tables. Thank you.
Inanc