我遇到了按钮单击事件的问题,想知道是否有人可以提供帮助?
这是我的asp代码:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/pcss3fs.css" />
</head>
<body>
<h1>
<asp:Image ID="Image1" runat="server" Height="57px" ImageUrl="~/img/logo.png"
Width="36px" />
<strong> Test</strong> System </h1>
<form action="" enctype="multipart/form-data" class="pcss3f">
<header><asp:Label ID="lblOverview" runat="server" Text=""></asp:Label></header>
<section class="state-normal" style="text-align:center">
<button type="button" onclick="window.location = 'AddItem.aspx'">Add Work Item</button>
<button type="button" id="btnMyWork" name="btnMyWork" onclientclick="btnMyWork_Click" runat="server">My Work Items</button>
<button type="button">Database Stats</button>
<br>
</br>
<asp:Label ID="lblWhoAmI" runat="server" Text=""></asp:Label>
</section>
<footer><asp:Label ID="lblWhoAmI2" runat="server" Text=""></asp:Label></footer>
</form>
</body>
</html>
我指的按钮是这样的:
<button type="button" id="btnMyWork" name="btnMyWork" onclientclick="btnMyWork_Click" runat="server">My Work Items</button>
这是我试图让它运行的VB:
Protected Sub btnMyWork_Click()
lblOverview.Text = "Success"
lblWhoAmI.Text = "Success"
End Sub
但是当我点击它时,什么也没有发生。我尝试在 aspx.vb 代码中添加点击处理程序,但“.click”不会显示在 IntelliSense 中。
任何帮助表示感谢