-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegistration.aspx.cs
87 lines (74 loc) · 3 KB
/
Registration.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Registration : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
// try
// {
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ToString());
con.Open();
SqlCommand cmd;
string a = "INSERT INTO CustomerInfo values(@p1,@p2,@p3,@p4,@p6,@p7,@p8,@p9,@p10,@p11)";
cmd = new SqlCommand(a, con);
cmd.Parameters.AddWithValue("@p1", txtName.Text);
cmd.Parameters.AddWithValue("@p2", txtEmail.Text);
cmd.Parameters.AddWithValue("@p3", txtPassword.Text);
cmd.Parameters.AddWithValue("@p4", rbtnListGender.SelectedValue.ToString());
cmd.Parameters.AddWithValue("@p6", txtMobile.Text);
cmd.Parameters.AddWithValue("@p7", txtEno.Text);
cmd.Parameters.AddWithValue("@p8", sem.SelectedValue.ToString());
cmd.Parameters.AddWithValue("@p9", department.SelectedValue.ToString());
cmd.Parameters.AddWithValue("@p10",collage.SelectedValue.ToString());
cmd.Parameters.AddWithValue("@p11", "0");
cmd.ExecuteNonQuery();
lblMessage.Text = "Registration Done";
// ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);
txtName.Text = "";
txtEmail.Text = "";
txtPassword.Text = "";
txtMobile.Text = "";
txtEno.Text = "";
con.Close();
//}
//catch (Exception e1)
//{
// string message = "Registration Error";
// ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);
//}
}
protected void btnClear_Click(object sender, EventArgs e)
{
txtName.Text = "";
txtEmail.Text = "";
txtPassword.Text = "";
txtMobile.Text = "";
txtEno.Text = "";
string message = "Registration Error";
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);
}
protected void btnClear_Click1(object sender, EventArgs e)
{
txtName.Text = "";
txtEmail.Text = "";
txtPassword.Text = "";
txtMobile.Text = "";
txtEno.Text = "";
string message = "Registration Error";
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);
}
}