Thursday, 15 September 2011

mvcsitemap - Can a title attribute be added to links generated by asp.net sitemap? -


I Msivi site'm using map provider and it is working well, but I code a <> The attribute on the a href tag generated by title Sitemap. Is there a way to do this?

MVC manufacturers Saitmapprowaider has confirmed that this is a bug in version 3. He gave the following code changes That's what worked.

SiteMapNodeModel.cshtml:

  @ model MvcSiteMapProvider.Web.Html.Models.SiteMapNodeModel @using system Web.Mvc.Html @ MvcSiteMapProvider.Web.Html.Models @f (Model.IsCurrentNode & amp; model. SourceMetadata [ "HtmlHelper"]. ToString ()! = "MvcSiteMapProvider.Web.Html.MenuHelper") {& lt; Text & gt; @ Model.Title & lt; / Text & gt; } And if (model. IClickable) {if (string.IsNullOrEmpty (Model.Description)) {& lt; A href = "@ Model.Url" & gt; @model.title & lt; / A & gt; } Else {& lt; A href = "Model. Yule" title = "@Models.Details" & gt; @model.title & lt; / A & gt; }} Other {& lt; Text & gt; @model.title & lt; / Text & gt; }    

No comments:

Post a Comment