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
精彩评论