即使在表格中也无法访问按钮 [英] Can not access the button even in table

查看:58
本文介绍了即使在表格中也无法访问按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个表和一个按钮,但是我什至无法选择按钮,因为它在表中(我认为),那么如何访问按钮事件?
这是代码:

Hi,
I have a table and a button in it, but I can''t even select the button because it''s in table(I think), so how can I access to buttons event?
This is the code:

<    asp:Table ID="Table1" runat="server" Height="235px" Width="397px">
    <asp:TableRow>
    <asp:TableCell>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>




谢谢.




Thanks.

推荐答案

首先,为什么需要asp:Table.您可以直接使用Table.之后,将事件添加到按钮,您就可以访问事件.
First of all Why do you need asp:Table. Directly you can make use of Table. After that add the event to the button and you can access the event.


您可以使用HTML Table代替asp Table.

如果您仍然想访问按钮事件,您可以说:

You can use HTML Table instead of asp Table.

If u still want to access the button event you can say:

<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />



并在:
中编写代码 Button1_Click()
{
//在这里写你的代码
}事件



and write the code in :
Button1_Click()
{
//write your code here
} event


使用常规的html表标签


使控件和布局正确对齐




< asp:button ---- =" xmlns:asp =#unknown">


像这样在该单元格中使用标签和放置控件
use normal html table tags


to get proper alignment for controls and layouts




<asp:button ----="" xmlns:asp="#unknown">


like that use tags and place controls in that cells


这篇关于即使在表格中也无法访问按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆