如何使用asp.net突出显示母版页中的选定链接 [英] How to highlight selected link in master page using asp.net

查看:66
本文介绍了如何使用asp.net突出显示母版页中的选定链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主页主页联系帮助中有几个链接,我添加了三个内容页面Home.aspx,contact.aspx和help.aspx添加到母版页中的链接。如何突出显示所选链接,例如当我点击主页时我想突出显示主页,如联系方式帮助





我的代码是



masterpage.master



< form>



< asp:ContentPlaceHolder ID =ContentPlaceHolder1runat =server>



< / form>

解决方案





将有一种称为Hover属性的样式,您可以使用它。更改该属性中的背景颜色。



(ex)

这里HomeMenu是我的菜单项名称。在你的样式表中发布以下代码。



#HomeMenu:悬停
{
背景:#0066CC ;
}





请参阅以下链接,



< a href =http://stackoverflow.com/questions/17060426/how-to-highlight-active-page-in-a-masterpage-menu> http://stackoverflow.com/questions/17060426/how-to -highlight-active-page-in-a -pagepage-menu [ ^ ]



问候,

BlueSathish


I have several links in my master page Home contact Help, and i have added three content pages Home.aspx,contact.aspx and help.aspx added to links in master page . how to highlight selected link, for example when i click Home i want to highlight Home like contact help also


my code is

masterpage.master

<form>


<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</form>

解决方案

Hi,

There will be one style available called Hover property, you can use that. Change the background color in that property.

(Ex)
Here HomeMenu is my Menu item name. Post this below code in your style sheet.

#HomeMenu:hover
{
    background: #0066CC;
}



Refer this below link,

http://stackoverflow.com/questions/17060426/how-to-highlight-active-page-in-a-masterpage-menu[^]

Regards,
BlueSathish


这篇关于如何使用asp.net突出显示母版页中的选定链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆