开发者

Hiding user interface parts in WSS 3.0 webpart - how?

开发者 https://www.devze.com 2022-12-21 23:42 出处:网络
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

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.

0

精彩评论

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