如何通过链接按钮发回信息 [英] how to do post back by link button
本文介绍了如何通过链接按钮发回信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些验证标注控件,我有三个按钮,可以进行编辑,更新,取消
但是每当验证控件无效时,取消按钮均不起作用
我已经用过
i have some validation callout controls i have three buttons edit, update,cancel
but cancel button is not working whenever any of validation control is invalid
i have already used
function returnTrue()
{
return true;
}
<asp:linkbutton id="cancel" runat="server" onclientclick="return returnTrue(); true;">
推荐答案
代码问题.
1)没有设置OnClick
属性.
2)删除onclientclick
中多余的true;
.您已经从returnTrue()
函数返回true
.如下更改代码.
Couple of issues with your code.
1) NoOnClick
Property set.
2) Remove that extratrue;
in youronclientclick
. You are already returningtrue
from yourreturnTrue()
function. Change your code as below.
<asp:linkbutton id="cancel" runat="server" onclientclick="return returnTrue();" onclick="cancel_Click" >
3)如果您在上面注意到我已将cancel_Click
事件分配给OnClick
,则应在您的代码隐藏区中定义它.
3) If you noticed above I have assigned cancel_Click
event to OnClick
, then it should be defined in your code-behind.
void cancel_Click(object sender, System.EventArgs e)
{
//Your Button Clcik code here.
}
这篇关于如何通过链接按钮发回信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文