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

VS 2010 using MVC3 All Code Rendered at top of source

1 Answer 43 Views
Getting started with ASP.NET
This is a migrated thread and some comments may be shown as answers.
DThom
Top achievements
Rank 1
DThom asked on 16 Dec 2010, 12:22 AM
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">
//<![CDATA[
jQuery(document).ready(function(){
jQuery('#myMenu').tMenu();});
//]]>
</script><!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<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>
<div id="logindisplay">
<a id="loginLink" href="/Account/LogOn">
<img src="/Images/Site/icon_lock.png" width="26" /> Click Here To Login
</a>


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

Thanks,
David

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Dec 2010, 11:32 AM
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.

Regards,
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
Getting started with ASP.NET
Asked by
DThom
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or