Putting a hole into forms authentication?

H

harrismax

My application uses forms authentication. On the sign-in page is a form (with takes a username, a password, and has a button [SignUp]) that allows for the creation of new user accounts

I'm trying to get it so that when the SignUp (not SignIn) button is clicked, a user account is created in the database, and the forms authentication stuff is taken care of, so that I can redirect a user to another page (CustomerInfo.aspx) so they can continue filling out their account information

The problem is that I can't figure out how to get past the forms authentication mechanism so that new users get to the the other page (CustomerInfo.aspx)

private void SignUpButton_Click(object sender, System.EventArgs e
{
string SqlStatement = "INSERT INTO Customers (UserName, Password) VALUES ('" + SignUpUserName.Text.Trim() + "', '" + SignUpPassword.Text.Trim()+ "')"

SqlConnection Connection = new SqlConnection("server=*********; database=********; Trusted_Connection=SSPI")
SqlCommand Command = new SqlCommand(SqlStatement, Connection)
SqlDataReader Reader = null

Connection.Open()
Reader = Command.ExecuteReader()
while(Reader.Read()

if (Int32.Parse(Reader[0].ToString()) >= 1

SignUpError.Text = "<p><b>Signup successful.</b></p>"

SetCookie(SignUpUserName.Text.Trim(), SignUpPassword.Text.Trim(), "NEWUSR")
// can't authenticate here - I have tried several methods
Server.Transfer("CustomerInfo.aspx")

els

SignUpError.Text = "<p><b>Signup failed.</b></p>"
return


Connection.Close();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top