Asp:Menu after disabled looks like Active

Hi I am using asp.net application and I am using asp:menu. At one point I am disabling menu but on IE11 and chrome It still looks like active(It's not clickable but color looks same), I tried to change menu color from codebehind but when It switch back to that menu as enabled then it doesn't work properly,How I can fix this problem?

Regards,
Sudhanshu
SudhanshumAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

louisfrCommented:
The active MenuItem should be an <a> element with a href attribute, and the inactive one an <a> element without href.
You can control how they are displayed by setting the style for the <a> element and a different style for a:link
a {
    color: green
}
a:link {
    color: red
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SudhanshumAuthor Commented:
Can you please elaborate more. How can i use this a tag in Code behind code using Menu Item only. Because when my Link is enable false i want different color and when it enable true at that time i want different color.

I had also use this code:
when enable false : M1Menu.FindItem("ACC").Text = "<div style='color: #a3a3a3'>" + M1Menu.FindItem("ACC").Text + "</div>"

when enable true:  M1Menu.FindItem("ACC").Text = "<div style='color: #284E98'>" + M1Menu.FindItem("ACC").Text + "</div>"

But When i refresh my page, it is not working properly.
0
louisfrCommented:
You enable or disable the MenuItem by setting its Enabled property to true or false and let css do the color changing.
0
louisfrCommented:
I provided an answer. I don't know if it has been understood and tested.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.