Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET
c#.code:
 
sqlcon.Open();
sqlcom = new SqlCommand("insert into table(no) values(" + max_id.text + ")", sqlcon);
sqlcom.ExecuteNonQuery();
sqlcon.Close();
 

html code:
<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 12-Apr-13 3:50am
Edited 12-Apr-13 3:55am
v3
Comments
ThePhantomUpvoter at 12-Apr-13 8:51am
   
This is not a question and your SQL is invalid anyway.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is how you can call JS from C#.
 Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "confirm_meth();", true);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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");
 
  }
}
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "alert('Patient Assessment created successfully');", True)
  Permalink  
v3

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

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 230
2 BillWoodruff 205
3 DamithSL 165
4 Sergey Alexandrovich Kryukov 155
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,650
3 Kornfeld Eliyahu Peter 3,460
4 Sergey Alexandrovich Kryukov 2,811


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 15 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100