禁用页面回发 [英] disable page post back

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

问题描述

你好朋友,

我有关于回发的问题.

我有2个链接按钮.如果按回车键,则第一个链接按钮将发布回服务器,但我想将第二个发布回,而不是第一个.

如何在按Enter键时设置这样的优先级?

在此先感谢.

Hello friends,

I have a problem regarding post-back.

I have 2 link buttons. If I press enter then first link button is posting back to server, but I want to make the second one post back rather than the first.

How can I set priorities like this on pressing enter key?

Thanks in Advance.

推荐答案

可以将名为defaultbutton的属性设置为默认按钮.在面板或表单中将dafault按钮设置为2个链接按钮.
A property named defaultbutton is available to set as the default button. set your dafault button as 2 link button in panel or in form.


谢谢您的提问.请遵循以下代码.
Thank you for your question. Follow the bellow code.
<asp:Button ID="Button1" runat="server" Text="btnFirstButton" OnClientClick="return false" />
<asp:Button ID="Button2" runat="server" Text="btnSecondButton" />


谢谢,
马蒙


Thanks,
Mamun



只需在uraspx页面中放置一个asp面板即可.并将默认按钮名称设为您的第二个bitton id. 希望对您有帮助..

just place an asp panel inside uraspx page..and make that the default button name as ur second bitton id..here am giving you one example..
Hope this may help you..
<asp:panel id="Panel1" runat="server" defaultbutton="btn2" xmlns:asp="#unknown">
<asp:button id="btn1" runat="&"server"/">
<asp:button id="btn2" runat="server" />


这篇关于禁用页面回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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