开发者

How to show Ajaxtoolkit modal popup extendar only if textbox1.text="show" esle do not show?

开发者 https://www.devze.com 2023-02-12 17:42 出处:网络
I have a textbox1 and button1 and panel1 (which is used as a popup control) i want if textbox1.text=\"show\" then modalpopup control whos开发者_运维技巧e id is panel1 will be visible on buttonclick e

I have a textbox1 and button1 and panel1 (which is used as a popup control)

i want if textbox1.text="show" then modalpopup control whos开发者_运维技巧e id is panel1 will be visible on buttonclick event other wise .... modal popup control panel1 will not be shown ...

how to do this ? using vb.net ?


Use Javascript's getElementById method to determine if the text has that specific value and then call showPopup() if you want to.

function showPopup() {
    var modalPopupBehavior = $find('programmaticModalPopupBehavior');
    modalPopupBehavior.show();
}
function hidepopup() {
    var modalPopupBehavior = $find('programmaticModalPopupBehavior');
    modalPopupBehavior.hide();
}

I know you stated, you want to do this in vb.net, but then you're at server-side and it is far easier to deal with this on client-side if you don't have something not to.


Here's how you do in code-behind. Add this to your button click event:

If TextBox1.Text = "something" Then
    ModalPopupExtender1.Show()
Else
    ModalPopupExtender1.Hide()
End If
0

精彩评论

暂无评论...
验证码 换一张
取 消