Posted on: 5/27/2013 8:16:26 PM | Views : 280

Hi all,
     I am having two on-click function in my ASP.NET Web page, I need to get the selected value of first function to the another one..,
And the code is as follow..


public void Button1_Click(object sender, EventArgs e) { string UN = Session["UN"].ToString(); SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=MAXESSITE;Trusted_Connection=True"); conn.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO Checkinout (LoginDT ,NAME ,UN ) VALUES (@LoginDT, @NAME, @UN)" + "Select Scope_Identity()", conn); cmd.Parameters.AddWithValue("@LoginDT", Label1.Text); cmd.Parameters.AddWithValue("@NAME", Label4.Text); cmd.Parameters.AddWithValue("@UN", UN); ID = Convert.ToInt32(cmd.ExecuteScalar()); } public void Button2_Click(object sender, EventArgs e) { string UN = ...

Go to the complete details ...