This question is locked. New answers and comments are not allowed.
Hai,
I Need code for Menu sitemap binding using vb.net.
C# Code In Telerik Demo SIte:
namespace Telerik.Web.Mvc.Examples
{
using System.Web.Mvc;
public partial class MenuController : Controller
{
public ActionResult SiteMapBinding()
{
if (!SiteMapManager.SiteMaps.ContainsKey("sample"))
{
SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap =>
sitmap.LoadFrom("~/sample.sitemap"));
}
return View();
}
}
}
I try to convert the telerik demo c# code to vb.net. but "expression does not produce a value" error occured
Converted vb.net Code
Imports System.Web.Mvc
Namespace Telerik.Web.Mvc.Examples
Public Partial Class MenuController
Inherits Controller
Public Function SiteMapBinding() As ActionResult
If Not SiteMapManager.SiteMaps.ContainsKey("sample") Then
Return View()
End Function
End Class
End Namespace
Please rectify the error. and give me the sample code for bind menu using sitemap in vb.net.
I Need code for Menu sitemap binding using vb.net.
C# Code In Telerik Demo SIte:
namespace Telerik.Web.Mvc.Examples
{
using System.Web.Mvc;
public partial class MenuController : Controller
{
public ActionResult SiteMapBinding()
{
if (!SiteMapManager.SiteMaps.ContainsKey("sample"))
{
SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap =>
sitmap.LoadFrom("~/sample.sitemap"));
}
return View();
}
}
}
I try to convert the telerik demo c# code to vb.net. but "expression does not produce a value" error occured
Converted vb.net Code
Imports System.Web.Mvc
Namespace Telerik.Web.Mvc.Examples
Public Partial Class MenuController
Inherits Controller
Public Function SiteMapBinding() As ActionResult
If Not SiteMapManager.SiteMaps.ContainsKey("sample") Then
SiteMapManager.SiteMaps.Register(Of XmlSiteMap)("sample", Function(sitmap) sitmap.LoadFrom("~/sample.sitemap"))
End IfReturn View()
End Function
End Class
End Namespace
Please rectify the error. and give me the sample code for bind menu using sitemap in vb.net.