linkbutton


How to set backcolor property of the linkbutton set to visible only if it is clicked?


I have three linkbuttons on my web page. I have provided backcolor of the linkbutton, but I want it to be visible only if that particular linkbutton is clicked. Please suggest how can I do this?
My code is like this-
protected void Link_Click(object sender, EventArgs e)
{
LinkButton lbtn = (LinkButton)sender;
lbtn.BackColor = System.Drawing.Color.Blue;
string id = lbtn.ID;
if (id == "lnkcot")
{
###
}
else if (id == "lnktex")
{
###
}
else if (id == "lnkgar")
{
###
}
}
Thank You
I got it how to do this. . .!
Just set other two link button backcolor equal to transparent. Check below.
protected void Link_Click(object sender, EventArgs e)
{
LinkButton lbtn = (LinkButton)sender;
lbtn.BackColor = System.Drawing.Color.Blue;
string id = lbtn.ID;
if (id == "lnkcot")
{
// set other two to transparent
lnktex.BackColor = Color.Transparent;
lnkgar.BackColor = Color.Transparent;
}
else if (id == "lnktex")
{
lnkcot.BackColor = Color.Transparent;
lnkgar.BackColor = Color.Transparent;
}
else if (id == "lnkgar")
{
lnkcot.BackColor = Color.Transparent;
lnktex.BackColor = Color.Transparent;
}
}

Related Links

How to set backcolor property of the linkbutton set to visible only if it is clicked?
hit enter key Link Button not working firefox
LinkButton not accessing EventArg

Categories

HOME
freeradius
eclipse-plugin
adfs3.0
command-prompt
embedded-resource
odata
android-emulator
dronekit-python
liferay-7
navigation
dji-sdk
visualforce
video-streaming
haxe
joomla3.2
graphql-js
tfs2010
jpa-criteria
lapack
smooks
orc
powermock
ex
vmware-workstation
susy-sass
office-ui-fabric
android-custom-view
fluent-migrator
react-dnd
web-push
jpa-2.1
tracing
openbravo
android-service
materialize
dnsmasq
unmarshalling
quick-nimble
delayed-job
riotjs
wampsharp
caesar-cipher
cucumber-junit
devtools
gnu-classpath
polyml
bean-validation
autoencoder
dreamfactory
stackpanel
djcelery
linq.js
jqgrid-asp.net
morphline
nomad
jshint
daz3d
icecast
scala-breeze
photoswipe
brightscript
non-linear-regression
stateless-session-bean
openerp-6
perl-data-structures
pbx
researchkit
multi-touch
django-testing
yii2-model
noclassdeffounderror
mnesia
flipclock
flask-security
cortana
stack-smash
text-align
jolie
string.format
configurable-product
nesper
igor
osascript
aho-corasick
treeline
accessory
preorder
iirf
ax
aero
oembed
significant-digits
spark-view-engine
struts2-json-plugin
wndproc
voice-recording
kaazing
liveconnect
wiktionary
fbml
infopath-2007
fork-join
sql-parametrized-query
azure-acs
git-log
.net-services
rational-unified-process
community-server

Resources

Encrypt Message