菜单控制 - 当前节点 [英] Menu Control - current node

查看:59
本文介绍了菜单控制 - 当前节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在母版页上使用新的ASP.NET 2.0菜单控件。

有没有办法让当前页面成为实时链接,理想情况下也是b $ b b让它以不同的风格出现?


类似于sitemappath控件'的RenderCurrentNodeAsLink属性。


TIA


-


AG

电子邮件:讨论在adhdata dot com


解决方案

" AG" < NO ********** @ newsgroups.nospamwrote in message

news:%2 **************** @ TK2MSFTNGP02。 phx.gbl ...


在母版页上使用新的ASP.NET 2.0菜单控件。

有没有办法不让当前页面成为实时链接,理想情况下,
也会以不同的风格出现?


类似于sitemappath控件的RenderCurrentNodeAsLink属性。



我认为只有使用< asp:Menu>属性才能实现。


代码死了很容易,但是......


小心提示?


-


AG

电子邮件:讨论在adhdata dot com


" Mark Rae" < ma ** @ markNOSPAMrae.com写信息

news:en ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
" AG" < NO ********** @ newsgroups.nospamwrote in message

news:%2 **************** @ TK2MSFTNGP02。 phx.gbl ...


>在母版页上使用新的ASP.NET 2.0菜单控件。
有没有办法没有当前页面是一个实时链接,理想情况下它也会以不同的样式出现?

类似于sitemappath控件的RenderCurrentNodeAsLink属性。



我不认为只有< asp:Menu>的属性才能实现。


代码死了很容易,但是......



你好AG,


如果你在Menu控件上使用DataBinding,你可以处理它的'b
DataBound事件并更改当前项:


protected void Menu1_DataBound(object sender ,EventArgs e)

{

if(Menu1.SelectedItem.NavigateUrl == Request.Path)

{

Menu1.SelectedItem.Selectable = false;

}

}


此致,

Walter Wang(wa****@online.microsoft.com,删除''在线。'')

Microsoft在线社区支持


==== ==============================================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。如果您使用的是Outlook Express,请确保清除

复选框工具/选项/读取:一次获取300个标题及时看到你的回复




注意:MSDN托管新闻组支持服务是针对非紧急问题

其中来自社区或Microsoft支持的初步响应

工程师可在1个工作日内完成。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。


Using the new ASP.NET 2.0 menu control on a master page.
Is there any way to NOT have the current page be a live link and ideally
also have it appear in a different style?

Similar to the sitemappath control''s RenderCurrentNodeAsLink property.

TIA

--

AG
Email: discuss at adhdata dot com


解决方案

"AG" <NO**********@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...

Using the new ASP.NET 2.0 menu control on a master page.
Is there any way to NOT have the current page be a live link and ideally
also have it appear in a different style?

Similar to the sitemappath control''s RenderCurrentNodeAsLink property.

I don''t think it''s possible just with the <asp:Menu>''s properties.

Dead easy in code, though...


Care to give a hint?

--

AG
Email: discuss at adhdata dot com

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:en**************@TK2MSFTNGP03.phx.gbl...

"AG" <NO**********@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...

>Using the new ASP.NET 2.0 menu control on a master page.
Is there any way to NOT have the current page be a live link and ideally
also have it appear in a different style?

Similar to the sitemappath control''s RenderCurrentNodeAsLink property.


I don''t think it''s possible just with the <asp:Menu>''s properties.

Dead easy in code, though...



Hi AG,

If you are using DataBinding on the Menu control, you can handle it''s
DataBound event and change current item:

protected void Menu1_DataBound(object sender, EventArgs e)
{
if (Menu1.SelectedItem.NavigateUrl == Request.Path)
{
Menu1.SelectedItem.Selectable = false;
}
}

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于菜单控制 - 当前节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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