Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I think, i have not clarified how i want it.

1.How first msg box contain both (yes and no) option, i want exactly like that.Means second msg box also contain msg title and both (yes and no) option.Importantly i have to access that second msg confirmation value.(this happening based on onclientclick event))
2.In first msg box, after confirmation i got confirmation value as below:
C#
if(Addflag==1)
                       string confirmvalue = Request.Form["confirm_value"];//for first msg("are you want to save");
                        if (confirmvalue== "Yes")
                        {
                            con.Close();
                            con.Open();
                            sqlcmd2 = new SqlCommand("INSERT INTO city_name(C_name) VALUES('" + txtbox_city.Text + "')", con);
                            sqlcmd2.ExecuteNonQuery();
                            txtbox_city.Text = string.Empty;
                        }
                        else if (confirmvalue == "No")
                        {
                           msg("cancelled");
                        }
                        }
3.So now i want like that same confirmation value for second msg box like:
                 if(Addflag==1)
                       string confirmvalue = Request.Form["confirm_value"];//for first msg("are you want to save");
                        if (confirmvalue== "Yes")
                        {
                            con.Close();
                            con.Open();
                            sqlcmd2 = new SqlCommand("INSERT INTO city_name(C_name) VALUES('" + txtbox_city.Text + "')", con);
                            sqlcmd2.ExecuteNonQuery();
                            txtbox_city.Text = string.Empty;
                        }
                        else if (confirmvalue == "No")
                        {
                           msg("cancelled");
                        }
                        }
               if (Editflag == 1)
                {
                    string edit_qry = "select * from ledger_details where L_city='" + PrevCname + "'";
                    con.Close();
                    con.Open();
                    sqlcmd2 = new SqlCommand(edit_qry, con);
                    sqlreader2 = sqlcmd2.ExecuteReader();
                    if (sqlreader2.HasRows)
                    {
                        string confirmvalue = Request.Form["confirm_value"]; //second msg("this record in the main table, are you sure to edit this?.");
                        if (confirmvalue == "Yes")
                        {
                            con.Close();
                            con.Open();
                            string edit_update = "Update ledger_details set L_city='" + Cname + "' where L_city='" + PrevCname + "' ";
                            sqlcmd2 = new SqlCommand(edit_update, con);
                            sqlcmd2.ExecuteNonQuery();
                            con.Close();
                            con.Open();
                            string edit_update1 = "Update city_name set C_name='" + Cname + "' where C_ID='" + row_id + "'";
                            sqlcmd2 = new SqlCommand(edit_update1, con);
                            sqlcmd2.ExecuteNonQuery();
                            txtbox_city.Text = string.Empty;
                        }
                        else 
                        {
                             message( "You have cancelled to save the city name..");
                           
                        }
                    }
Posted
Updated 23-Feb-15 0:09am
v3
Comments
Thanks7872 23-Feb-15 6:40am    
Don't you think that replying to some one is different than posting a whole new question? You have posted same question third time. Use reply button on comments. Stop posting same question over and over again. Its not allowed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900