为什么我在 Visual Studio 中的 HTML 按钮在双击时没有创建事件处理程序? [英] Why are my HTML buttons in Visual Studio not creating Event Handlers when double clicked?
问题描述
我已使用 HTML 将按钮添加到 Visual Studio 2015 中的 Web 表单中.所以这些按钮在设计选项卡中.当我双击设计"选项卡中的按钮时.它没有打开 ASPX.CS 页面.这是正常的吗?我的印象是我会那样工作.相反,我必须去手动编码每个事件处理程序.
I have added buttons into a web form in Visual Studio 2015 using HTML. So those buttons are in the design tab. When i double click the button in the Design Tab. It is not opening the ASPX.CS page. Is that normal? I was under the impression that i would work like that. Instead i have to go and manually code each event handler.
我在谷歌上搜索过并尝试在 Visual Studio 上进行修复,但没有找到.
I have searched google and tried to run repairs on Visual Studio but found no avail.
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="Module2LabExercise.WebForm1" %>
<!DOCTYPE html>
<html>
<head>
<title>
Currency Converter
</title>
</head>
<body>
<form runat = "server">
<div>
Convert:
<input type = "text" ID = "US" runat = "server" />
U.S. dollars to
<select ID = "Currency" runat = "server" />
<br /> <br />
<input type = "submit" value = "OK" ID = "Convert"
OnServerClick = "Convert_ServerClick" runat = "server" />
<input type = "submit" value = "Show Graph" ID = "ShowGraph"
OnServerClick = "ShowGraph_ServerClick" runat = "server" />
<br /> <br />
<img id="Graph" runat="server" src="//:0"/>
<br /> <br />
<p style = "font-weight: bold" ID = "Result" runat = "server"
>
</p>
</div>
</form>
</body>
</html>
</表单>