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

[Solved] Asp.net MVC Q3 2010 Rendering Issue

1 Answer 58 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark Richardson
Top achievements
Rank 1
Mark Richardson asked on 17 Dec 2010, 08:18 PM
I followed the instructions of how to setup an MVC application.

A few issues I am having.
  1. I have trying to put an editor inside an "absolute positioned" "<DIV>" tag.
    For some reason, it doesn't display inside the tag. It will always display the control in the upper right hand corner.
  2. I notice when I do a "View Source". I notice that all the telerik code is actually inserted "above" the "beginning <HTML>" tag.
    What's up with that?
  3. When the editor does render, I see only "links and text" in a vertical format.
    There is no editor.
  4. I am trying this with an MVC3 Razor app which still should be able to load the older MVC2 .dlls.

Here is my code in my "RenderBody()" View.

 <div>       
@{
        Html.Telerik().Editor()
            .Name("Editor_Advertisement")
            .HtmlAttributes(new { width = "500px" })
            .Value("Test")
            .Render();          }    
    </div>

Here is my code in my "LayOut (MasterPage)" View.

<head>
    <title>@View.Title</title>
    <link href="@Url.Content("~/content/css/main_style.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/scripts/promotion6_scripts.js")" type="text/javascript"></script>
    @*
    <script src="@Url.Content("~/Scripts/jquery-1.4.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    *@

    @{ 
 
        Html.Telerik().StyleSheetRegistrar()
                .DefaultGroup(group => group.Add("telerik.common.css")
                                            .Add("telerik.vista.css"));
    }
</head>

What's going on here?

Thanks,
Mark Richardson

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Dec 2010, 09:09 AM
Hello Mark Richardson,

 This will not work in Razor:
@{
        Html.Telerik().Editor()
            .Name("Editor_Advertisement")
            .HtmlAttributes(new { width = "500px" })
            .Value("Test")
            .Render();          }

What will work is this:

@(Html.Telerik().Editor()
            .Name("Editor_Advertisement")
            .HtmlAttributes(new { width = "500px" })
            .Value("Test"))

You can check this blog post and this code library entry to see how to use Razor with Telerik Extensions for ASP.NET MVC.

Greetings,

Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Mark Richardson
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or