0

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 refresh 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?

truthseeker
  • 2,214
  • 6
  • 30
  • 53

2 Answers2

0

The answer for this question is AJAX. For example asp:updatepanel can be used.

truthseeker
  • 2,214
  • 6
  • 30
  • 53
0

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.

Andre Kraemer
  • 2,633
  • 1
  • 17
  • 28