We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Convent cshtml to vbhtml (Razor CS => VB.net)

I'm having trouble using the controls because the examples are all present in cshtml and I have to translate them step by step. I'm trying to create a menu with a defined list, but I got stuck in this:

@Html.EJ().Menu("menujson").MenuFields(f => f.Datasource(CType(ViewBag.datasource, IEnumerable(Check.Controllers.CheckController.icons)).Id("pid").Text("mtext").ParentId("parent").SpriteCssClass("sprite"))

Can someone help with?

1 Reply

KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 23, 2015 12:39 PM UTC

Hi Saulo,

Thanks for using Syncfusion products.

Query: I'm having trouble using the controls because the examples are all present in cshtml and I have to translate them step by step. I'm trying to create a menu with a defined list, but I got stuck. Can someone help with?

We can achieve your requirement by modifying the “MenuFields” property of Menu component. In this we need to give the “DataSource” as sub items of “MenuFields” property using “Sub()” method.

Please refer the following code snippet to use the menu control with “Datasource”.

[vbhtml]

 

@Html.EJ().Menu("menujson").MenuFields(Sub(menuf) menuf.Datasource(ViewBag.datasource).Id("pid").Text("mtext").ParentId("parent").SpriteCssClass("sprite"))

 

For your convenience we have prepared a simple sample based on your requirement. You can also download the attached sample from the following location.

Sample Link: Menu-sample

In the above sample, we have used our Menu control for demo. If you still face any problems, please revert back us with your sample and replication procedure. This would be helpful for us to provide you the exact solution.

Please let us know if you have any queries.

Regards,

Kaliswaran S


Loader.
Live Chat Icon For mobile
Up arrow icon