I have a webpart with asp.net control within. I would like to hide some parts of that control, some asp:net panels etc. regarding one of the TextBox's value. The issue is that I don't know to change the visibility of asp:panel wrapper without any postback, and how to refres开发者_如何学运维h page to see the changes on the UI. I was trying to implement TextChanged event but it dosen't work. Can anybody help me, please?
The answer for this question is AJAX. For example asp:updatepanel can be used.
I'd go for a pure client side solution using JavaScript / jQuery.
So you could some jQuerycode like this (untestet)
<script>
$(document).ready(function(){
$.(Id$='IdOfYourTextBox').blur(function(){
$.(Id$='IdOfYourPanel').hide();
});
});
</script>
You could register this script from your webpart using the ClientScriptManager RegisterClientScriptBlock Method.
精彩评论