控制没有转移到断点 [英] Control is not transferring to the break point

查看:72
本文介绍了控制没有转移到断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用updatepanel这里是我的aspx代码



< asp:UpdatePanel ID =   MyUpdatePanel UpdateMode =  条件 runat =   server> 
< ContentTemplate>



< a id =btnSaverunat =serverclass =button> submit

 <   / ContentTemplate  >  
< 触发器 >

< asp:AsyncPostBackTrigger ControlID = btnSave EventName = ServerClick / >

< /触发器 >
< / asp:UpdatePanel >





我的c#代码:



< pre lang =cs> public void btnSave_ServerClick( object 发​​件人,EventArgs e)
{
...
}

这里的问题我点击btnsave时它没有将控件转移到btnsave(没有点击 break 点btnsave)
请帮我 out

解决方案

替换

 <   asp:UpdatePanel     ID   =   MyUpdatePanel    UpdateMode   = 条件    runat   =  server >  
< ContentTemplate >
< a id = btnSave runat = server < span class =code-attribute> class = 按钮 > 提交
< / ContentTemplate >
< < span class =code-leadattribute>触发器 >
< asp:AsyncPostBackTrigger ControlID = btnSave EventName = ServerClick / >
< / Triggers >
< / asp:UpdatePanel >



with

 < ;   asp:UpdatePanel     ID   =  MyUpdatePanel    UpdateMode   = 条件    runat   = 服务器 >  
< ContentTemplate >
< asp:按钮 id = btnSave runat = server < span class =code-attribute> onclick = btnSave_Click 文字 = 提交 / >
< / ContentTemplate >
< 触发器 >
< asp:AsyncPostBackTrigger < span class =code-attribute> ControlID = btnSave / >
< / Triggers >
< / asp:UpdatePanel >





现在写下你的代码

  public   void  btnSave_Click( object  sender,EventArgs e) 
{

}





我用按钮替换锚标签。因为锚标记不会在服务器端触发事件。你必须使用按钮。事实上,如果你在更新面板中有一个按钮,你甚至不必使用触发器。


Hi iam using an updatepanel here is my aspx code

<asp:UpdatePanel ID="MyUpdatePanel" UpdateMode="Conditional" runat="server">
       <ContentTemplate>


<a id="btnSave" runat="server" class="button">submit

</ContentTemplate>
        <Triggers>
          
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="ServerClick" />
           
        </Triggers>
    </asp:UpdatePanel>



my c# code:

public void btnSave_ServerClick(object sender,EventArgs e)
{
...
}
  
the problem here is ,when i click btnsave its not transferring the control to the btnsave(not hitting the break point of btnsave)
pls help me out.

解决方案

Replace

<asp:UpdatePanel ID="MyUpdatePanel" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<a id="btnSave"  runat="server" class="button">submit
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSave" EventName="ServerClick" />
</Triggers>
</asp:UpdatePanel>


with

<asp:UpdatePanel ID="MyUpdatePanel" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button id="btnSave" runat="server" onclick="btnSave_Click" Text="Submit"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSave" />
</Triggers>
</asp:UpdatePanel>



Now write in your code behind

public void btnSave_Click(object sender,EventArgs e)
{

}



I have replace anchor tag with button. Because anchor tag does not fire event on server side. You have to use button. In fact you don''t even have to use trigger if you have a button inside update panel.


这篇关于控制没有转移到断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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