Code for Data submit Successfully message in Asp.net

Sandeepraturi
Posted by Sandeepraturi under C# category on | Points: 40 | Views : 2079
--------------put this into head tag---------------


<script type="text/javascript">
function ok()
{
alert('Data submit successfully');
}
</script>


----------------------c# code-------------------

protected void btnsubmit_Click1(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into tb_un_assets_info values('"+txt.Text+"')",con);
con.open();
cmd.ExecuteNonQuery();
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "ok();", true);
con.close();
}

Comments or Responses

Login to post response