本文介绍了ascx页面中的按钮在asp.net中无法单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在.ascx页面中创建asp:按钮时,

它不可点击(我的意思是点击时,.ascx.cs中的函数不会被调用..)



for exp ..我的页面是tester.ascx

i调用

when i make asp:button in .ascx page ,
it is not clickable (i mean when clicked, the function in .ascx.cs is not called..)

for exp.. my page is tester.ascx
i call as

<asp:button id="ButtonDef" text="Search" OnClick="ButtonDef_Click" runat="Server">





和tester.ascx .cs,我有





and in tester.ascx.cs , i have

protected void ButtonDef_Click(object sender, EventArgs e)
    {
}



但是没有被称为



和来源,我得到了




but that is not called

and in source , i get as

<input id="ctl00_ContentHome_UserSearchBoxControl_ButtonDef" type="submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentHome$UserSearchBoxControl$ButtonDef", "", true, "", "", false, false))" value="Search" name="ctl00$ContentHome$UserSearchBoxControl$ButtonDef"></input>

推荐答案




这篇关于ascx页面中的按钮在asp.net中无法单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 02:50