Note that there are some explanatory texts on larger screens.

plurals
  1. POform submission in webpage confirmation
    primarykey
    data
    text
    <p>the code below accepts the text in the form and insets it into the table.i wanted to it to add to the table and redirect to the same page after displaying the message "data has been added".But the problem is that it is getting redirected to the target page but not displaying the message.im guessing that is because the cmd.ExecuteQuery(); is generating a response and is getting redirected...</p> <p>but i want it to show the message. what changes should i do.thanks in advance</p> <pre><code>protected void Button2_Click(object sender, EventArgs e) { string v = System.Configuration.ConfigurationManager.ConnectionStrings["harish"].ConnectionString; con = new OracleConnection(v); con.Open(); string query="insert into leave_module1 values(:name,:desig,:srno,:tol,:compdates,:fd,:td,:nod,:remarks)"; OracleCommand cmd = new OracleCommand(query, con); //OracleCommand.BindByName = true; try { cmd.Parameters.Add(":name", OracleType.VarChar, 50).Value = DropDownList2.Text; cmd.Parameters.Add(":desig", OracleType.VarChar, 30).Value = TextBox10.Text; cmd.Parameters.Add(":srno", OracleType.Number, 8).Value = TextBox8.Text; cmd.Parameters.Add(":tol", OracleType.VarChar, 10).Value = DropDownList1.Text; cmd.Parameters.Add(":compdates", OracleType.VarChar, 30).Value = TextBox9.Text; cmd.Parameters.Add(":fd", OracleType.DateTime).Value = TextBox3.Text; cmd.Parameters.Add(":td", OracleType.DateTime).Value = TextBox4.Text; cmd.Parameters.Add(":nod", OracleType.Number, 3).Value = TextBox5.Text; cmd.Parameters.Add(":remarks", OracleType.VarChar, 50).Value = TextBox7.Text; cmd.ExecuteNonQuery(); ClientScript.RegisterStartupScript(Page.GetType(), "validation", "&lt;script language='javascript'&gt;alert('The Data has been added')&lt;/script&gt;"); Response.Redirect("Default2.aspx"); } catch { Label13.Visible = true; } con.Close(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload