Add membership number field

Topics: Help, Request
Apr 7, 2007 at 12:00 AM
What would be the easiest way to add a field to the create user form. I need to add our hiking club membership number to the new user form. Thank you.
Coordinator
Apr 7, 2007 at 5:14 PM
Could you clarify this a little... do you want the person to have "This user is #--" or do you just want it to display the person's number on registration?
Apr 8, 2007 at 4:28 PM

z2bass wrote:
Could you clarify this a little... do you want the person to have "This user is #--" or do you just want it to display the person's number on registration?


Our hiking club has about 1300 members each with a membership number like 6549A, I would like to have a field that they could input this number in when creating a user account on the club website.

Thanks

Coordinator
Apr 8, 2007 at 5:58 PM
Oh, now I see :). These are the steps you need to take.

1) Add a field in the MemberInfo Table (For this ex, I will use memnum as a varchar(50)
2) Now you need to open App_Code/DataSet.xsd
3) Right click on the MemberInfo table adapter and select configure
4) Change the text for the select statement to say

 SELECT memnum, newsletter, memberid, address, phone, firstname, lastname, DATALENGTH(avatar) AS AvatarSize FROM MemberInfo
5) Next, Unclick Fill Table, Finish, Save
6) Open App_Code/MemberDetails.vb
7) Add the following to the end just before 'End Class'

Private m_MemNum As String
    Public ReadOnly Property MemberNumber() As String
        Get
            Return m_MemNum
        End Get
    End Property

8) Right after 'mnewsletter = member.newsletter' on line 33, make a new line and enter 'mMemNum = member.memnum' and save
9) Open your memberinfo table and enter some value for the existing names
10) Open Member/Details.aspx
11) Go into design mode and add a row in the member details table
12) Make a textbox and call it memnum
13) Right under 'Phone.Text = mr.phone' in line 67 put 'memnum.Text = mr.memnum'
14) Clange line 45 to read
da.Update(memnum.Text, AllowEmail, CType(user.ProviderUserKey, Guid), Addr.Text, Phone.Text, fname.Text, lname.Text, CType(user.ProviderUserKey, Guid))

15) Open Member/register.aspx
16) Go to design view, select the wizard in the update panel and go to step 2
17) Add a row bellow in the table and make a textbox called memnum
18) Change line 12 to read
da.Insert(memnum.Text, NewsletterCheck.Checked, CType(user.ProviderUserKey, Guid), Addr.Text, Phone.Text, fname.Text, lname.Text)

19) Go back to design mode and change the wizard step back to step 1
20) Save it... and run it!
Apr 8, 2007 at 8:47 PM
Edited Apr 8, 2007 at 9:04 PM

z2bass wrote:
Oh, now I see :). These are the steps you need to take.

1) Add a field in the MemberInfo Table (For this ex, I will use memnum as a varchar(50)
2) Now you need to open App_Code/DataSet.xsd
3) Right click on the MemberInfo table adapter and select configure
4) Change the text for the select statement to say

 SELECT memnum, newsletter, memberid, address, phone, firstname, lastname, DATALENGTH(avatar) AS AvatarSize FROM MemberInfo
5) Next, Unclick Fill Table, Finish, Save
6) Open App_Code/MemberDetails.vb
7) Add the following to the end just before 'End Class'

Private m_MemNum As String
    Public ReadOnly Property MemberNumber() As String
        Get
            Return m_MemNum
        End Get
    End Property

8) Right after 'mnewsletter = member.newsletter' on line 33, make a new line and enter 'mMemNum = member.memnum' and save
9) Open your memberinfo table and enter some value for the existing names
10) Open Member/Details.aspx
11) Go into design mode and add a row in the member details table
12) Make a textbox and call it memnum
13) Right under 'Phone.Text = mr.phone' in line 67 put 'memnum.Text = mr.memnum'
14) Clange line 45 to read
da.Update(memnum.Text, AllowEmail, CType(user.ProviderUserKey, Guid), Addr.Text, Phone.Text, fname.Text, lname.Text, CType(user.ProviderUserKey, Guid))

15) Open Member/register.aspx
16) Go to design view, select the wizard in the update panel and go to step 2
17) Add a row bellow in the table and make a textbox called memnum
18) Change line 12 to read
da.Insert(memnum.Text, NewsletterCheck.Checked, CType(user.ProviderUserKey, Guid), Addr.Text, Phone.Text, fname.Text, lname.Text)

19) Go back to design mode and change the wizard step back to step 1
20) Save it... and run it!


Thank you for the great instructions, works like a charm.

The only thing that doesn't show is the member number in member/list.aspx.
Coordinator
Apr 9, 2007 at 10:09 AM
You need to go in and add it... look at the templated code labels for the repeater and just add in a new label for the memnum with Text='<%# Eval("MemberNumber") %>'
Apr 9, 2007 at 4:03 PM

z2bass wrote:
You need to go in and add it... look at the templated code labels for the repeater and just add in a new label for the memnum with Text='<%# Eval("MemberNumber") %>'


Works great, thank you for taking the time to help me with this and thank you again for the great project.