This is a migrated thread and some comments may be shown as answers.

[Solved] System.Web.Mvc.HtmlHelper

3 Answers 349 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Harish
Top achievements
Rank 1
Harish asked on 28 Nov 2011, 01:18 PM
Hi,

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Telerik' and no extension method 'Telerik' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 52:             </div>
Line 53:             <div id="menucontainer">
Line 54:                 @(Html.Telerik().Menu()
Line 55:                     .Name("menu")
Line 56:                     .Items(menu =>

I am getting this error while running my application .

Regards,
Harish Chepuri.

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Nov 2011, 01:57 PM
Hello Harish,

I believe the following thread will be of help:
http://www.telerik.com/community/forums/aspnet-mvc/installer-vs-extensions/tag-telerik-not-recognized-but-the-project-builds.aspx


All the best,
Georgi Tunev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Harish
Top achievements
Rank 1
answered on 28 Nov 2011, 02:35 PM
Hi,
Thank u for giving reply ,my problem was resolved but menu items are coming one below another but i need like main menu items should be horizontal and sub item should be in vertical ,i tried with orientation property but i am not getting correctly.

i pasting my layout.cshtml script

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
   @* <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/EditorHookup.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/RangeDateValidator.js")" type="text/javascript"></script>*@
    @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.Windows7.css").Combined(true).Compress(true)))
    @*<style type="text/css">
        .webGrid
        {
            margin: 4px;
            border-collapse: collapse;
            width: 1000px;
        }
        .header
        {
            background-color: #E8E8E8;
            font-weight: bold;
            color: #FFF;
        }
        .webGrid th, .webGrid td
        {
            border: 1px solid #C0C0C0;
            padding: 5px;
        }
        .alt
        {
            background-color: #E8E8E8;
            color: #000;
        }
        .person
        {
            width: 200px;
            font-weight: bold;
        }
    </style>*@
</head>
<body>
    <div class="page">
        <div id="header">
            <div id="title">
                <h1>
                    My MVC Application</h1>
            </div>
            <div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <div id="menucontainer">
               
                        @(Html.Telerik().Menu().Name("menu").Orientation(MenuOrientation.Horizontal)
                    .Items(menu =>
                    {
                        menu.Add().Text("Home").Items(item =>
                        {
                            item.Add().Text("Client").Action("Index", "Client");
                            item.Add().Text("List").Action("Index", "List");
                            item.Add().Text("Campaign").Action("Index", "Campaign");

                        });
                        menu.Add().Text("About").Action("About", "Home");
                    }))
                  
            </div>
        </div>
        <div id="main">
            @RenderBody()
            <div id="footer">
            </div>
        </div>
    </div>
    @(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)))
</body>
</html>
Regards,
Harish Chepuri.
0
Daniel
Telerik team
answered on 29 Nov 2011, 02:14 PM
Hi Harish, 

I attached a project which uses the same Layout View as the one you sent. I also added a screenshot to show that it is working properly on my side.

Probably the reason for your menu being vertically aligned is a CSS conflict or a missing file. Could you please check that?

Best wishes,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Menu
Asked by
Harish
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Harish
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or