Desktop modules - User Controls in MVC3 RAZOR

  1. #1

    Desktop modules - User Controls in MVC3 RAZOR

    Hi,
    i'm triyng to get the desktop example working in MVC3 RAZOR.

    I have a view which has the desktop components, with a menu item like this:

    menuItems.Add(Html.X().MenuItem()
                                .Text("Add module")
                                .DirectEvents(directEvents =>
                                {
                                    directEvents.Click.Url = "Home/AddModule2";
                                    directEvents.Click.Before = "this.disable();";
                                    directEvents.Click.ExtraParams.Add(Html.X().Parameter()
                                        .Name("desktopId")
                                        .Value("Desktop1")
                                        .Mode(ParameterMode.Value)
                                    );
                                })
                            );
    In the controller I have the method which loads the desktop module i want, from a user control:

     public ActionResult AddModule2(string desktopId)
            {
                AjaxResult r = new AjaxResult();
                Desktop desktop = X.GetCmp<Desktop>(desktopId);
                var control = Ext.Net.Utilities.ControlUtils.FindControl<Ext.Net.DesktopModuleProxy>(new ViewUserControl().LoadControl("~/Views/Shared/WhatsNew.ascx"));
                control.RegisterModule();
    
                return r;
            }
    It works nice!

    Now I want to load the desktop module, not from a ascx usercontrol, but from a MVC partial view, using RAZOR to write it.

    If I replace "~/Views/Shared/WhatsNew.ascx" with the respective razor view: "~/Views/Shared/WhatsNew.cshtml", I get the error: "" does not inherit from 'System.Web.UI.UserControl'.

    It is quite obvious! :)

    How can i change the controller Action to search for the control in a cshtml page, and not in a ascx control file?

    Thank you, millenovanta.
  2. #2

    Something planned?

    Since there were no answers...

    Is planned some change relating to this in 2.1 release?

    Thanks
  3. #3
    I agree that this would be very helpful and stay more true to the MVC razor model. Has there been any progress on this or is it being considered for a future release?
  4. #4
    I had no answer about it... I'm stuck at this point...
  5. #5
    v2.1 will include MVC Examples Explorer
    We will try to include Desktop examples under Razor
  6. #6
    Quote Originally Posted by Vladimir View Post
    v2.1 will include MVC Examples Explorer
    We will try to include Desktop examples under Razor
    Excellent! Do you have an estimated timeframe for v2.1?

    Thanks for your help and quick response!

    Markus
  7. #7
    Perfect! I trust in the Desktop example under Razor.

    When more or less the 2.1 will be available?
    Thanks.
  8. #8
    Hello,

    Ext.NET v2.1 has been released.

    But, unfortunately, we could not include extended Desktop Razor into this release.

    Currently it is already in SVN and will be included into a next release.
  9. #9
    Many thanks Daniil.
    I'll wait for the next release for that implementation.

    Thanks.

Similar Threads

  1. How to load dynamic user controls on desktop shortcut?
    By laphuynhkien in forum 2.x Help
    Replies: 4
    Last Post: Aug 23, 2012, 5:58 PM
  2. MVC3 Razor: Desktop button is not working
    By nahuel2203 in forum 2.x Help
    Replies: 0
    Last Post: Jun 24, 2012, 3:02 AM
  3. Replies: 0
    Last Post: Jun 15, 2012, 9:06 AM
  4. [CLOSED] How add Modules in Web Desktop
    By hrc in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 30, 2012, 12:31 PM
  5. Ext.Net with MVC3(Razor)
    By abanikumar in forum 1.x Help
    Replies: 4
    Last Post: Jan 16, 2012, 9:55 AM

Posting Permissions