[CLOSED] [2.0] MVC DirectEvent Error

  1. #1

    [CLOSED] [2.0] MVC DirectEvent Error


    I'm receiving the following error when clicking the "Button 1" button:

    Server Error in '/' Application.
    The control with ID 'ctl02' not found
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Web.HttpException: The control with ID 'ctl02' not found
    Source Error:
    Line 2965:                        throw new HttpException("The control with ID '{0}' not found".FormatWith(controlID));
    Line 2966:                    }
    Line 2967:                }
    Line 2968:            }
    Line 2969:
    Source File: D:\Application\Library\Required Dependencies\Ext.NET\Source\2.0.0.DP1\Ext.Net\Core\ResourceManager\ResourceManager.cs    Line: 2967
    Stack Trace:
    [HttpException (0x80004005): The control with ID 'ctl02' not found]
       Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) in D:\Application\Library\Required Dependencies\Ext.NET\Source\2.0.0.DP1\Ext.Net\Core\ResourceManager\ResourceManager.cs:2967
       Ext.Net.ResourceManager.Page_AjaxLoadComplete(Object sender, EventArgs e) in D:\Application\Library\Required Dependencies\Ext.NET\Source\2.0.0.DP1\Ext.Net\Core\ResourceManager\ResourceManager.cs:2797
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3922
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
    <!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">
    Here is the source code for the Login.cshtml:
        Layout = "~/Views/Shared/Layout.cshtml";
        .Buttons(a =>
                .Text("Button 1")
                .DirectEvents(events =>
                    events.Click.Buffer = 300;
                    events.Click.FormID = "FormPanel1";
                    events.Click.Method = Ext.Net.HttpMethod.POST;
                    events.Click.Url = Url.Action("Action", "Controller");
                } )
        } )
        .Items(a =>
                .Items(b =>
                        .Listeners(listeners =>
                            listeners.AfterRender.Buffer = 300;
                            listeners.AfterRender.Handler = "this.focus();";
                        } )
                        .BoxLabel("Remember Me")
                } )
    Any suggestions?

    Last edited by Daniil; Jan 20, 2012 at 12:31 PM. Reason: [CLOSED]
  2. #2
    If DirectEvent is used with Razor then you have to use url which points to controller action, webservice or something else
    The way is used in your sample (inline delegate) will not be supported because there is no way to handle it (there is no 'Control' term under Razor)
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Can you provide an example of how to wire it for MVC?

  4. #4
    Here you are.

    Example View
        Layout = "";        
    <!DOCTYPE html>
        <title>Ext.NET Razor Example</title>
            .Text("I am the Buttom with Click DirectEvent")
            .DirectEvents(directEvents => {
                directEvents.Click.Url = "/Examples/HelloWorld";
    Example Controller Action
    public ActionResult HelloWorld()
        string script = X.Msg.Alert("DirectEvent", "Hello World!").ToScript();
        return new AjaxResult(script);

Similar Threads

  1. [CLOSED] dynamic menupanel causing error after 2 click (directevent)
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 22, 2011, 2:44 AM
  2. Replies: 1
    Last Post: Jun 09, 2011, 7:04 PM
  3. [CLOSED] DirectEvent throwing error for controls creating at runtime
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: May 23, 2011, 6:34 PM
  4. TextField DirectEvent Blur Error
    By David Pelaez in forum 1.x Help
    Replies: 5
    Last Post: Dec 21, 2010, 12:32 PM
  5. [CLOSED] Error adding DirectEvent to columnmodel
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 07, 2010, 2:11 PM

Tags for this Thread

Posting Permissions