Can someone more knowledgeable about Telerik PanelBars take a look at my problem. We're evaluating the Telerik ASP.NET MVC tools and running into a showstopper. Thanks!
So when I try to implement the PanelBar as per installation isntructions on a brand new ASP.NET MVC2 website it works fine. But, when I try and implement on my legacy site (which I converted to WAP/MVC2 a while ago) it doesn't work.
On the legacy site, the bars show correctly, but when the page loads, a javascript error appears and I cannot click on the panelbar. The javascript error is:
Line: 24
Char: 1
Error: Object Expected
Code: 0
URL: http://localhost:47002/FAQS/Main/ViewPanel
Line 24 looks like this:
jQuery(document).ready(function(){
The view source for the code is as follows:
-----------------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
ViewPanel
</title><link type="text/css" href="/Content/2010.3.1318/telerik.common.min.css" rel="stylesheet"/>
<link type="text/css" href="/Content/2010.3.1318/telerik.vista.min.css" rel="stylesheet"/>
</head>
<body>
<div>
<ul class="t-widget t-panelbar t-reset" id="PanelBar"><li class="t-item t-state-default"><a class="t-link t-header" href="#PanelBar-1">Item 1<span class="t-icon t-arrow-down t-panelbar-expand"></span></a><div class="t-content" id="PanelBar-1" style="display:none">
<p>Content</p>
</div></li><li class="t-item t-state-default"><span class="t-link t-header">Item 2<span class="t-icon t-arrow-down t-panelbar-expand"></span></span><ul class="t-group" style="display:none"><li class="t-item t-state-default"><span class="t-link">Sub Item 1</span></li><li class="t-item t-state-default"><span class="t-link">Sub Item 2</span></li><li class="t-item t-state-default"><span class="t-link">Sub Item 3</span></li></ul></li></ul>
</div>
<script type="text/javascript" src="/Scripts/2010.3.1318/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.3.1318/telerik.common.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.3.1318/telerik.panelbar.min.js"></script>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
jQuery('#PanelBar').tPanelBar({expandMode:1});});
//]]>
</script>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is the ViewPanel view page code:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<title>ViewPanel</title>
<%= Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group.Add(
"telerik.common.css")
.Add(
"telerik.vista.css"))
%>
</head>
<
body>
<div>
<% Html.Telerik().PanelBar()
.Name(
"PanelBar")
.Items(items =>
{
items.Add().Text(
"Item 1")
.Content(() =>
{%>
<p>Content</p>
<% });
items.Add().Text(
"Item 2")
.Items(subItems =>
{
subItems.Add().Text(
"Sub Item 1");
subItems.Add().Text(
"Sub Item 2");
subItems.Add().Text(
"Sub Item 3");
});
})
.Render();
%>
</div>
<%= Html.Telerik().ScriptRegistrar() %>
</body>
</
html>