Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 16, 2012 02:13 PM by banksidepoet
Participant
774 Points
862 Posts
Nov 16, 2012 01:40 PM|LINK
Hi,
I am using a Response.Redirect in the Click event of a LinkButton to navigate to another page.
If X condition is true, I want to be able to disable the LinkButton's functionality:
Don't worry about the IF statement, just how do I stop a LinkButton behaving like a link?
Thanks
All-Star
95275 Points
14072 Posts
Nov 16, 2012 01:51 PM|LINK
first set LinkButton.Enabled to false....and then on top of it apply your custom css using LinkButton.CssClass to have your interested CSS....
thanks.
Member
140 Points
43 Posts
Nov 16, 2012 01:55 PM|LINK
Add a class
<style type="text/css"> .asLabel { cursor:default; text-decoration:none; color:Black; } </style>
Use following code in code behind :
if condition then
LinkButton1.CssClass = "asLabel" LinkButton1.Enabled = False
endif
Nov 16, 2012 02:13 PM|LINK
Perfect.
Thank you.
banksidepoet
Participant
774 Points
862 Posts
Remove link functionality from LinkButton
Nov 16, 2012 01:40 PM|LINK
Hi,
I am using a Response.Redirect in the Click event of a LinkButton to navigate to another page.
If X condition is true, I want to be able to disable the LinkButton's functionality:
Don't worry about the IF statement, just how do I stop a LinkButton behaving like a link?
Thanks
ramiramilu
All-Star
95275 Points
14072 Posts
Re: Remove link functionality from LinkButton
Nov 16, 2012 01:51 PM|LINK
first set LinkButton.Enabled to false....and then on top of it apply your custom css using LinkButton.CssClass to have your interested CSS....
thanks.
JumpStart
Rahul Antil
Member
140 Points
43 Posts
Re: Remove link functionality from LinkButton
Nov 16, 2012 01:55 PM|LINK
Add a class
<style type="text/css">
.asLabel
{
cursor:default;
text-decoration:none;
color:Black;
}
</style>
Use following code in code behind :
if condition then
LinkButton1.CssClass = "asLabel"
LinkButton1.Enabled = False
endif
banksidepoet
Participant
774 Points
862 Posts
Re: Remove link functionality from LinkButton
Nov 16, 2012 02:13 PM|LINK
Perfect.
Thank you.