[CLOSED] PartialView in MVC4

  1. #1

    [CLOSED] PartialView in MVC4

    Hi,

    I tried doing the example from this post http://forums.ext.net/showthread.php...ll=1#post83329 with MVC4 but nothing happen when I click render view. Here is the code:
    /Home/Index.cshtml:
    @using Ext.Net
    @using Ext.Net.MVC
    @{
        Layout = "";    
    }
    <!DOCTYPE html>
    <html>
    <head>
        <title>@ViewBag.Title</title>    
    </head>
    <body>    
        @Html.X().ResourceManager()
    
        @(Html.X().Panel()
            .ID("Panel1")
            .Padding(5)
            .Layout(LayoutType.Fit)
            .BodyPadding(5)
            .Title("Panel1")
            .Width(400)
            .Height(200)
            .Icon(Icon.Add)
            .Buttons(buttons => {
                buttons.Add(Html.X().Button().Text("Render view").DirectEvents(e => {
                    e.Click.Url = "/Home/PartialRazorView/";
                    e.Click.EventMask.ShowMask = true;
                    e.Click.ExtraParams.Add(new Parameter("containerId", "App.Panel1"));
                }));
            })
         )
    
         @(Html.X().Panel()
            .ID("Panel2")
            .Padding(5)
            .BodyPadding(5)
            .Title("Panel2")
            .Width(400)
            .Height(200)
            .Icon(Icon.Add)
            .Buttons(buttons => {
                buttons.Add(Html.X().Button().Text("Render view").DirectEvents(e => {
                    e.Click.Url = "/Home/PartialRazorView2/";
                    e.Click.EventMask.ShowMask = true;
                    e.Click.ExtraParams.Add(new Parameter("containerId", "App.Panel2.body.id", ParameterMode.Raw));
                }));
            })
         )
    </body>
    </html>
    /Home/PartialRazorView.cshtml:
    @using Ext.Net.MVC
    
    @(
        Html.X().Panel()
        .Title("Panel from partial view")
        .Content(@<text>
                <h3>Simple content</h3>
                @Html.X().Button().Text("Button")
            </text>)
    )
    /Controllers/HomeComtroller.cs
    public class HomeController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public Ext.Net.MVC.PartialViewResult PartialRazorView(string containerId)
            {
                return new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.AddTo);
            }
    
            public Ext.Net.MVC.PartialViewResult PartialRazorView2(string containerId)
            {
                return new Ext.Net.MVC.PartialViewResult(containerId, RenderMode.RenderTo);
            }
        }
    Do you have any idea to resolve this problem in MVC4

    Thanks in advance,
    Last edited by Daniil; Jul 27, 2012 at 10:35 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please ensure you didn't forget assemblyBinding.
    http://forums.ext.net/showthread.php...ll=1#post84656

    What is a DirectEvent response when you click the Button?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please ensure you didn't forget assemblyBinding.
    http://forums.ext.net/showthread.php...ll=1#post84656

    What is a DirectEvent response when you click the Button?
    Thank you. I forgot assemblyBinding.

Similar Threads

  1. [CLOSED] [MVC-Razor] How to pass Model to Ext PartialView
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 01, 2012, 8:17 AM
  2. [CLOSED] Display error PartialView
    By bbo1971 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 27, 2012, 12:26 PM
  3. [CLOSED] Accessing the ID of ext component in a partialView
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 18, 2011, 9:09 PM
  4. [CLOSED] PartialView to replace the contents of a div.
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 22, 2011, 3:33 PM
  5. [CLOSED] Callback from a PartialView
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 11, 2010, 11:39 AM

Posting Permissions