Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data.SqlClient;
- public partial class Sign_Up_SignUpMain_1_ : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void btnNext_Click(object sender, EventArgs e)
- {
- string str = "Data Source=(LocalDB)\MSSQLLocalDB;";
- str += "AttachDbFilename=|DataDirectory|Database.mdf;";
- str += "Integrated Security= True";
- string email, userName;
- //Page
- if (Page.IsValid == true)
- {
- email = txtEmail.Text;
- userName = txtUserName.Text;
- SqlConnection c = new SqlConnection(str);
- SqlCommand sqlCommand = new SqlCommand("INSERT INTO [Table] (Email, UserName) VALUES (@email, @userName);", c);
- sqlCommand.Connection = c;
- sqlCommand.Parameters.AddWithValue("@email", email);
- sqlCommand.Parameters.AddWithValue("@userName", userName);
- c.Open();
- sqlCommand.ExecuteNonQuery();
- c.Close();
- Response.Redirect("SignUp(2).aspx", true);
- }
- //Email
- if (rfvEmail.IsValid == false || revEmail.IsValid == false)
- { txtEmail.CssClass = "txtError"; }
- else
- { txtEmail.CssClass = "Text"; }
- //User Name
- if (rfvUserName.IsValid == false || revUserName.IsValid == false)
- { txtUserName.CssClass = "txtError"; }
- else
- { txtUserName.CssClass = "Text"; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Data.SqlClient;
- public partial class Sign_Up_SignUp_2_ : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void btnNext_Click(object sender, EventArgs e)
- {
- string str = "Data Source=(LocalDB)\MSSQLLocalDB;";
- str += "AttachDbFilename=|DataDirectory|Database.mdf;";
- str += "Integrated Security= True";
- string password;
- //Page
- if (Page.IsValid == true)
- {
- password = txtPass.Text;
- SqlConnection c = new SqlConnection(str);
- SqlCommand sqlCommand = new SqlCommand("INSERT INTO [Table] (Email, UserName) VALUES (@email, @userName);", c);
- Response.Redirect("SignUp(3).aspx", true);
- }
- //Password
- if (revPass.IsValid == false || rfvPass.IsValid == false)
- { txtPass.CssClass = "txtError"; }
- else
- { txtPass.CssClass = "Text"; }
- //Confirm Password
- if (rfvConPass.IsValid == false)
- { txtConPass.CssClass = "txtError"; }
- else
- { txtConPass.CssClass = "Text"; }
- //Compare Passwords
- if (cvPasswords.IsValid == false)
- {
- txtPass.CssClass = "txtError";
- txtConPass.CssClass = "txtError";
- txtPass.Text = "";
- txtConPass.Text = "";
- }
- else
- {
- txtPass.CssClass = "Text";
- txtConPass.CssClass = "Text";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement