如何从后面的代码设置ConfirmButtonExtender1的确认文本 [英] How to set confirm text of ConfirmButtonExtender1 from code behind

查看:165
本文介绍了如何从后面的代码设置ConfirmButtonExtender1的确认文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个ConfirmButtonExtender1并将目标控件ID设置为button1.

现在我已经在某些条件下显示了消息,我将在按钮的单击事件上得到提示.

请帮忙.


谢谢
Mohd wasif

Hi All,


I have a ConfirmButtonExtender1 and set target control id as button1.

Now i have show message on certain conditions that I will get on click event of button.

Please help.


Thanks
Mohd wasif

推荐答案

尝试一下

button1.ConfirmText =在此处输入文字"
Try this

button1.ConfirmText="Put the text here"




您必须将显示文本作为条件更改吗?.

这意味着您必须在服务器端或客户端检查条件

我的建议是为您的要求添加一些代码详细信息

并使用Jquery可以轻松处理这种情况

最好的
Hi,

you''ve to change displaying text as conditions right?.

That means where you''ve to check condition in server side or client side

My suggestion is put some code details for your requirement

And Use Jquery for that it''ll easy to handle that situations

All the Best


ConfirmButton Demonstration
Click Me



ConfirmButton Description

ConfirmButton is a simple extender that catches clicks on a button (or any instance of a type derived from Button) and displays a message to the user. If the "OK" button is clicked, the button or link functions normally. If not, the click is trapped and the button will not perform its default submit behavior; optionally, a client script is executed if the OnClientCancel property is set. This is useful for delete links or anything else that requires confirmation from the user.
ConfirmButton Properties

The control above is initialized with this code. The italic properties are optional:

<ajaxToolkit:ConfirmButtonExtender ID="cbe" runat="server"
    TargetControlID="LinkButton1"
    ConfirmText="Are you sure you want to click this?"
    OnClientCancel="CancelClick" />

    TargetControlID - The ID of the button or link for this extender to operate on.
    ConfirmText - The text to show when you want to confirm the click. (Note: HTML entities can be used here (ex: "&#10;" for new-line))
    OnClientCancel - The client-side script that executes when the cancel button is clicked in the confirm dialog.
    ConfirmOnFormSubmit - True if the confirm dialog should wait until just before the form submits to display. This is useful when ASP.NET validators are in use and the confirm should be shown only after all validators pass.
    DisplayModalPopupID - Optionally specifies the ID of a ModalPopup control to use for displaying the confirmation dialog (instead of window.confirm). When using DisplayModalPopupID, the following conditions must be met:
        The ModalPopup must be configured to work against the same TargetControlID as the ConfirmButton (and should work properly if the ConfirmButton is disabled).
        The ModalPopup must specify OkControlID and/or CancelControlID to identify the buttons corresponding to window.confirm''s OK/Cancel buttons.
        The ModalPopup must not specify OnOkScript or OnCancelScript.


这篇关于如何从后面的代码设置ConfirmButtonExtender1的确认文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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