本文介绍了hai,如何在alertbox中按钮动作事件genaret当时在数据库中插入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c#.code:



sqlcon.Open();

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

sqlcom.ExecuteNonQuery();

sqlcon.Close();





html代码:

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>

推荐答案

Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "confirm_meth();", true);


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");
 
  }
}



这篇关于hai,如何在alertbox中按钮动作事件genaret当时在数据库中插入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 07:48