如何在ASP.NET中使用JavaScript脚本
一)简单点的

如要在一个按钮上增加认证脚本,可以这样

<%@ Page Language="C#" %>

<SCRIPT language="javascript">



function getconfirm ()

{

if (confirm("Do you want to delete record?")==true)

return true;

else

return false;



}

</SCRIPT>



<script runat="server">

public void Page_Load(Object sender, EventArgs E) {

btnSubmit.Attributes.Add("onclick","return getconfirm ();");

}

void btnSubmit_Click(object sender, EventArgs e) {

Message.Text = "You entered your name as: " + txtName.Text;

}

</script>

<html>

<head>

</head>

<body>

<form runat="server">

Name: <asp:Textbox )==true)

return true;

else

return false;

}

这样就可以了,呵呵,以上是我在编程中从资料里总结出来的,也许对你有用。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-03-10
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-04
  • 2021-04-25
  • 2022-12-23
  • 2022-01-06
  • 2021-11-17
  • 2021-11-19
相关资源
相似解决方案