I'm a complete newby to C#, so this should be very simple!
I have a bound datagrid displaying members. There are a number of buttons using the asp:ImageButton for deleting user, etc.
I want to be able to hide a button using css style, but the 'hidden' or 'visble' string should be in a varable.
For example:
strStyle is being declared ok & populated with the correct string
the style is working when the visibilty is hardcoded
The problem is retrieving the strStyle variable...
Help please?
ali razaPosted Nov 10, 2007, 11:20 PM
there must be some perticular event on which u want to change the visibility of the button.
what is that?
change the visibility when that event occur. like I change the visibility of the image button on the onclick event of checkbox control.
<
html xmlns="http://www.w3.org/1999/xhtml" ><
head runat="server"> <title>Untitled Pagetitle> <script type="text/javascript"> function ImgBtnDelete_Init(){
var ImgBtnDelete = document.getElementById("ImgBtnDelete") if (ImgBtnDelete.style.visibility!="hidden")ImgBtnDelete.style.visibility=
"hidden"; elseImgBtnDelete.style.visibility=
"visible"}
script> head> <body> <form id="form1" runat="server"> <asp:ImageButton ID="ImgBtnDelete" Runat="server" ImageUrl="../Images/delete.jpg" AlternateText="Delete">asp:ImageButton> <asp:CheckBox ID="chk" runat="server" AutoPostBack="false" onclick="ImgBtnDelete_Init()" /> form> body> html>