Asp Net Button不起作用 [英] Asp Net Button doesn't work

查看:65
本文介绍了Asp Net Button不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用母版页。我使用母版页添加了default.aspx。我在此页面中添加了一个按钮。



我的aspx页面:



Hi everyone ,

I'm using masterpage. And i added a default.aspx using masterpage. After i added a button in to this page.

My aspx page :

<asp:Button ID="btn_kaydet" runat="server"  CssClass="buton_kayit_ekle"  Text="Kayıt Ekle" OnClick="btn_kaydet_Click" />





我的aspx.cs页面:





My aspx.cs page :

protected void btn_kaydet_Click(object sender, EventArgs e)
{
    tb_ad.Text = "Hello";
}







现在,问题是,按钮无效。当我尝试点击按钮时,我看不到任何鼠标悬停光标。就像按钮不存在一样。





此外,我无法在属性窗口中看到按钮事件。我只在源页面的OnClick命令中看到它们。




Now , problem is , button is not working. And when i try click to the button i can't see any mouse hover cursor. As like as the button isn't there.


Also i can't see buttons events in properties window. I see them just in source page's OnClick command.

推荐答案

为了使ASP.NET控件能够工作,它们需要在一个表单中回发到页面。
In order for ASP.NET controls to work, they need to be in a Form which posts back to the page.


我解决了这个问题。



我的按钮在表格中,哪一个是asp网络控件。所以我使用html表。按钮现在正常工作。
I solved the problem.

My button is in table , which one is a asp net control. So i use html table. And button is work now.


这篇关于Asp Net Button不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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