如何在ASP:Table标签中双击控件时自动生成事件代码 [英] How to Auto Generate Event Code on Double Click for Control in ASP:Table tag
问题描述
我没有看到与< ASP:TABLE>内的任何控件相关的事件标签。如图所示,我在后端代码窗口的属性窗口和顶部栏中看不到任何事件。
另外,当我尝试双击按钮时生成事件代码,整个表格被选中,双击不起作用。
I do not see events related to any control that is inside the <ASP:TABLE> tag. As shown in the images, I do not see any events in the Properties Windows as well as in the Top bar in the back end code window.
Also, when I try to double click on the button to generate the Event Code, the whole table gets selected and double click does not work.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sample1.aspx.cs" Inherits="SampleTest.Sample1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="label1" runat="server" Text="Enter Name:"></asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="textbox1" runat="server"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Button ID="button1" Text="Submit" runat="server" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>
< img src ='http://s15.postimg .org / 7yjlu94t7 / image.jpg'width ='600px'height ='500px'alt ='图像1'/>
< img src ='http://s29.postimg。 org / stgkqem3r / image.jpg'width ='600px'height ='500px'alt ='图像1'/>
< img src ='http://s7.postimg.org / norx8nx h7 / image.jpg'width ='600px'height ='500px'alt ='图像1'/>
<img src='http://s15.postimg.org/7yjlu94t7/image.jpg' width='600px' height='500px' alt='Image 1' />
<img src='http://s29.postimg.org/stgkqem3r/image.jpg' width='600px' height='500px' alt='Image 1' />
<img src='http://s7.postimg.org/norx8nxh7/image.jpg' width='600px' height='500px' alt='Image 1' />
推荐答案
表格控件不支持服务器 - 会外活动。你需要在客户端定义一些东西或在单元格内使用适当的控件。
如果我没记错,你不能双击服务器表中的控件。几年前我似乎记得这个问题了。最好的方法是在代码视图中或从属性窗口访问事件。
我会问你是否真的需要使用服务器表控件。除非你在服务器方面做一些事情,否则普通的html表是更好的选择。
The table control does not support server-side events. You need to define something on the client side or use the appropriate control inside the cell.
If I remember correctly you cannot double click on controls inside the server table. I seem to remember this issue from several years ago. Your best best is to access the events in code view or from the properties windows.
I would ask if you really need to use a server table control. Unless you are doing something server side with it a normal html table is a better option.
这篇关于如何在ASP:Table标签中双击控件时自动生成事件代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!