View Full Version : Simple Panel and Asp.Net Mvc

7 May 2010, 10:58 AM
Im having some terrible trouble trying to perform a simple task and was looking for some advice or help.
Im using Asp.Net MVC 2.0 and Im want to add a panel to my page, and have the contents loaded from a partial view.

My page contains the following js:

Ext.onReady(function() {
var p = new Ext.Panel({
title: 'My Panel',
collapsible: true,
renderTo: document.body,
width: 400,
height: 200

url: '/home/mockdata',
success: function(response) {
var o = Ext.decode(response.responseText);

In my controller I have:

public PartialViewResult MockData()
return PartialView();

And my partialview contains something very simple:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<p>Lorem ipsum dolor sit amet.....</P>

However when my page loads, firebug shows the following error:

a.ownerCt.remove is not a function
[Break on this error] Ext.DomHelper=function(){var w=null,k=...lclick",this.onNodeDblClick,this)}});

This occurs after the get request. The response of the get request correctly contains the partialview.
Im not sure if I should be using Ext.decode(response.responseText).data in the jscript, but this doesnt help either.
Im abit stuck.

Any suggestions?


7 May 2010, 11:32 AM
Incase anyone reads this in future, I think I solved the problem, although not sure if its the correct way or not.

Rather than performing an Ext.Ajax.request, I simply put: