PartialViewResult: Error Returned from Controller Action

  1. #1

    PartialViewResult: Error Returned from Controller Action

    I am trying to display a partial view however I keep getting the error message: " Microsoft JScript runtime error: 'Ext' is undefined ".

    The error occurs on return from the Controller action.

    Code where controller action is being called (Email.aspx):
    <ext:Button ID="FileButton" runat="server" Text="File" Icon="Add" Disabled="true">
                                            <DirectEvents>
                                                <Click Url="/Personal/ActionsWindow/" >
                                                    <ExtraParams>
                                                        <ext:Parameter Name="record" Value="#{GridPanel1}.getRowsValues({ selectedOnly: true })[0]"
                                                            Mode="Raw" />
                                                    </ExtraParams>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
    Contoller action (PersonalController.cs):
            public Ext.Net.MVC.PartialViewResult ActionsWindow(String record)
            {
                Ext.Net.MVC.PartialViewResult p = new Ext.Net.MVC.PartialViewResult();
                return p;
            }
    Partial View (ActionsWindow.ascx):

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:Window ID="HoldAllWindow" runat="server" Width="600" Height="400" Modal="true"
        Hidden="true" Layout="Fit" Maximizable="true">
    </ext:Window>
  2. #2
    Hi,

    I tried the code you posted and it appears to be working fine.

    Could you post the response of this action?
  3. #3
    Hello Daniil

    If I set a breakpoint in the controller action then the execution of the code reaches there without any problems.

    If execution is continued then this happens:

    Click image for larger version. 

Name:	ExtUndefined.jpg 
Views:	127 
Size:	12.1 KB 
ID:	2467

    If ececution is continued again this happens:

    Click image for larger version. 

Name:	Request Failure.jpg 
Views:	116 
Size:	11.0 KB 
ID:	2468


    I solved the problem by setting Type="Load" for the direct event, which I should have realised would solve it as I asked about a problem relating to the same set of classes in this thread only the other day:
    http://forums.ext.net/showthread.php...k-it-should%29

    All the components in the class are wrapped in a form tag with runat="server". I don't quite understand why this happens?
  4. #4
    By default there is Type="Submit".

    Type="Submit" means that a form is submitted.

    If there is a FileUploadField on the page, the request expects the response with a file (IsUpload="true" for the action result). You don't pass a file, so, there is a bad response.

    Type="Load" means that a form is not submitted, therefore it works.

Similar Threads

  1. Replies: 0
    Last Post: Aug 14, 2012, 2:54 PM
  2. Replies: 0
    Last Post: Aug 14, 2012, 2:48 PM
  3. [CLOSED] [Razor] TreePanel load nodes from controller action
    By boris in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: May 18, 2012, 9:43 AM
  4. [CLOSED] How to display Confirm box from Controller Action in MVC
    By webppl in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 09, 2010, 9:31 PM
  5. [CLOSED] Error with PartialViewResult and GridPanel
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 02, 2010, 7:23 AM

Tags for this Thread

Posting Permissions