Jan 27, 2010, 10:12 AM
[CLOSED] PartialViewResult Problem
Hello,
The following example demonstrates an issue with the PartialViewResult from the MVC project:
Index.aspx:
1. Load page
2. Click Load button
3. Notice the contents from Example.ascx is loaded outside of the panel?
Any suggestions?
Cheers,
Timothy
The following example demonstrates an issue with the PartialViewResult from the MVC project:
Index.aspx:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!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>Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Panel ID="Panel1" runat="server"
Height="250"
Width="400">
<Content>
Click Load to Start.
</Content>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Load">
<Listeners>
<Click Handler="#{Panel1}.load( { scripts: true, params:{container: '#{Panel1}' }, url: '/Example/Example' } );" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Panel>
</body>
</html>
Example.ascx:<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<asp:Label ID="Label1" runat="server" Text="Successfully Loaded Word" />
ExampleController.cs:using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Ext.Net;
namespace Web.Controllers
{
public class ExampleController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Example(string container)
{
return new Ext.Net.MVC.PartialViewResult(container, RenderMode.RenderTo);
}
}
}
Replication steps:1. Load page
2. Click Load button
3. Notice the contents from Example.ascx is loaded outside of the panel?
Any suggestions?
Cheers,
Timothy