CrackerJack
New member
- Joined
- Feb 27, 2006
- Messages
- 1
- Programming Experience
- 1-3
Here's the situation. I'm creating a registration module for my website, and I don't want to use any wizards or anything that makes life easier. My goal is to truly understand everything that needs to happen, and the only way I can do that is to program it from scratch. In my file I'm making multiple trips to the server, and I'm hoping to some how cut that down if at all possible. Please help.
Here's the general contents of my register.aspx and the codebehind register.aspx.vb file: (for the sake of time (since I'm at work and don't have the files in front of me) I've listed them in shorthand)
Register.aspx:
1)Username Textbox w/ <customvalidator onServervalidate="validate_username"> - User name must be unique in the database
2)Email Textbox w/ <customvalidator onServerValidate="validate_email"> - Email address has to be unique in the database
3)Drop down list of states from database
4)Contact info textboxes w/ standard validators
Register.aspx.vb
Sub Page_Load(....)
populate_ddl(...)
if page.ispostback then
page.validate()
if Page.Isvalid then
create_new_user(username as string, email as string, contctinfo ect...)
end if
end if
end sub
sub populate_ddl()
1) open database
2) select states
3) bind to ddl
sub
Sub validate_username(.....)
1) connect to the database
2) check for existing username
3) if not unique send error, else page is valid
end sub
Sub validate_email(.....)
1) connect to the database
2) check for existing email
3) if not unique send error, else page is valid
end sub
Sub create_new_user(username as string, email as string, contact info etc)
1) connect to the database
2) insert info
end sub
.:CrackerJack:.
Here's the general contents of my register.aspx and the codebehind register.aspx.vb file: (for the sake of time (since I'm at work and don't have the files in front of me) I've listed them in shorthand)
Register.aspx:
1)Username Textbox w/ <customvalidator onServervalidate="validate_username"> - User name must be unique in the database
2)Email Textbox w/ <customvalidator onServerValidate="validate_email"> - Email address has to be unique in the database
3)Drop down list of states from database
4)Contact info textboxes w/ standard validators
Register.aspx.vb
Sub Page_Load(....)
populate_ddl(...)
if page.ispostback then
page.validate()
if Page.Isvalid then
create_new_user(username as string, email as string, contctinfo ect...)
end if
end if
end sub
sub populate_ddl()
1) open database
2) select states
3) bind to ddl
sub
Sub validate_username(.....)
1) connect to the database
2) check for existing username
3) if not unique send error, else page is valid
end sub
Sub validate_email(.....)
1) connect to the database
2) check for existing email
3) if not unique send error, else page is valid
end sub
Sub create_new_user(username as string, email as string, contact info etc)
1) connect to the database
2) insert info
end sub
.:CrackerJack:.