How to hide or disable <li> tag while checking condition in .cs page.

Posted by Pkanwar under ASP.NET on 5/15/2013 | Points: 10 | Views : 4210 | Status : [Member] | Replies : 1
we have <li><img src="" Title=""><p class="demo"></p></li> in aspx page.
Now we are checking a condition in .cs page like:
If condition is true, we want to hide above <li> column part to hide.
Any suggestion regarding to it, how to hide this <li> column if condition is true in .cs page.



Posted by: Rasik on: 5/16/2013 [Member] Starter | Points: 25

Example below uses disply property to hide/show list conrol on button click event. Make sure <li> is server control.

protected void btn1_Click(object sender, EventArgs e)
if(condition1 == true)
li.Style["Display"] = "none";
li.Style["Display"] = "inline"; //"block"


Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response