VS 2010 using MVC3 All Code Rendered at top of source

2 posts, 0 answers
  1. DThom
    DThom avatar
    1 posts
    Member since:
    Dec 2010

    Posted 15 Dec 2010 Link to this post

    I seem to be having an unusual problem.  I am trying to get the Telerik MVC controls to work in an MVC3 application.
    I am using Visual Studio 2010 professional.

    I have gotten the Telerik code to work, and I am able to output a simple menu.  Everything works as expected, the menu is generated and works and has the correct style applied.  

    The problem is that it does not render in the correct position.  It is always the 1st thing displayed on the page.  In fact ALL of the Telerik code that is rendered is output at the begining of the page.  

    If I view the html source of the page I will see it start with:
    <ul class="t-widget t-reset t-header t-menu" id="myMenu"><li class="t-item t-state-default"><span class="t-link">Parent 1<span class="t-icon t-arrow-down"></span></span><ul class="t-group"><li class="t-item t-state-default"><span class="t-link">Sub 1</span></li></ul></li><li class="t-item t-state-default"><span class="t-link">Parent 2</span></li></ul><link type="text/css" href="/Content/telerik.common.min.css" rel="stylesheet"/>
    <link type="text/css" href="/Content/telerik.sitefinity.min.css" rel="stylesheet"/>
    <script type="text/javascript" src="/Scripts/2010.3.1110/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="/Scripts/2010.3.1110/telerik.common.min.js"></script>
    <script type="text/javascript" src="/Scripts/2010.3.1110/telerik.menu.min.js"></script>
    <script type="text/javascript">
    </script><!DOCTYPE html>
    <title>Home Page</title>
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />
    <div class="page">
    <div id="header">
    <div id="title">
    <img src="../../Images/Site/icon_reporting.png" width="85" border="none" style="display:inline;" />
    <font size="5">Xpense Reporting</font>
    <div id="logindisplay">
    <a id="loginLink" href="/Account/LogOn">
    <img src="/Images/Site/icon_lock.png" width="26" /> Click Here To Login

    Am I missing some sort of configuration setting or something?  
    Any idea why Telerik outputs the code before the rest of the HTML?

  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 16 Dec 2010 Link to this post

    Hi David,

     This can occur if you are using the Render() method. This currently does not work with Razor as it is using Response.Write. I suggest you check this code library entry which shows how to use Telerik Extensions for ASP.NET MVC in Razor.

    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
Back to Top