Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
c#.code:

sqlcon.Open();
sqlcom = new SqlCommand("insert into table(no) values(" + max_id.text + ")", sqlcon);
sqlcom.ExecuteNonQuery();
sqlcon.Close();


html code:
XML
<script type="text/Javascript" language ="javascript" >
function confirm_meth()
{
  if( confirm("Do you want to continue!Click 'YES'")==true)
  {
        document.writeln ("<b>You had click on 'YES' Button</b>");
  }
 else
  {
      document.writeln ("<b>You had clic on 'NO' Button</b>");

  }
}
<pre lang="xml"><asp:Button ID="Btn_Submit" runat="server"
                               Text="Submit" onclick="Btn_Submit_Click" OnClientClick="return confirm_meth()"/>
</pre>
Posted
Updated 12-Apr-13 2:55am
v3
Comments
[no name] 12-Apr-13 8:51am    
This is not a question and your SQL is invalid anyway.

This is how you can call JS from C#.
C#
Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "confirm_meth();", true);
 
Share this answer
 
XML
function confirm_meth()
{
  if( confirm("Do you want to continue!Click 'YES'"))
  {
        document.writeln ("You had click on 'YES' Button");
  }
 else
  {
      document.writeln ("You had clic on 'NO' Button");
 
  }
}
 
Share this answer
 
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "alert('Patient Assessment created successfully');", True)
 
Share this answer
 
v3

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