如何在asp.net中使用c#button click事件强制回发? [英] How to forcefully postback using c# button click event in asp.net?

查看:135
本文介绍了如何在asp.net中使用c#button click事件强制回发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



如何在asp.net中使用c#按钮点击事件强制回发?

更新面板中的我的按钮和我不能使用



Hello,

How to forcefully postback using c# button click event in asp.net?
My Button in update panel and i can not use

<trigger>
<asp:PostBackTrigger ControlId="btnSubmit" />
</trigger>





因为我的代码有问题,我只想回发按钮点击事件。



请帮帮我。

如何才能使用c#代码?



先谢谢。< br $>


Ankit Agarwal

Web开发人员



because i have problem with this code, I want to postback only button click event.

Please help me.
How can it possible using c# code behind?

Thanks in Advance.

Ankit Agarwal
Web Developer

推荐答案

我怀疑你可能有验证在表单中触发规则,如果出现错误,它们将阻止几乎所有情况下的回发。如果你想要一个按钮回发,请确保按钮上的'CausesValidation = false'。
I suspect you might have Validation rules firing in the form and they will prevent a postback in almost all situations if there is an error. If you want a button to postback regardless, make sure 'CausesValidation=false' on the button.


这篇关于如何在asp.net中使用c#button click事件强制回发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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