Hiding Link by condition in CCS
Once my friend asked me about how to hide the Link in CodeCharge Studio by the condition. For example, suppose that we want to hide the Link if the one particular parameter exists in the GET request. I tryed to show it quickly to him but I wasn’t able. I added Hide-Show Component action to the Before Show event of the page. Link still was there. I was confused.
We decided to seek help in source material (Help topics F1) and we found! The problem was in Visible property of the Link. Let’s see the Visible Property description in CCS help.
When set to Dynamic, the component is wrapped within a special HTML template that allows it to be hidden programmatically at runtime.
In such a way, to fix this problem set Visible
property of the Link to Dynamic
and add Hide-Show Component
action to the Before Show
event of the Link.
This approach is valid also for:
- TextBox
- TextArea
- CheckBox
- Image
- Image Link
- Radio Button
- ListBox
- May be some other controls
I will use this at my Logout Link. Thanks for your explanation.