[CLOSED] Error with [DirectMethod(IDMode = DirectMethodProxyIDMode.None)]

  1. #1

    [CLOSED] Error with [DirectMethod(IDMode = DirectMethodProxyIDMode.None)]

    I do not understand this error, works fine locally on the server gives this error.

    System.NullReferenceException: Object reference not set to an instance of an object. at AfiSystem.FormActivosFijos._ActivosFijos_Movimientos.Imprimir(Int32 id) in C:\Proyectos\AplicadNet\AfiSystem\AfiSystem\FormActivosFijos\ActivosFijos_Movimientos.aspx.cs:line 93
    This is the code:

    [DirectMethod(IDMode = DirectMethodProxyIDMode.None)]
            public void Imprimir(int id)
            {
    
                DataSet dsDatos = Sentencias.GetDatos("Exec ReporteMovimiento_sp @ActivoFijo_MovimientoId =" + id.ToString());
                Session["dtLlevar"] = dsDatos.Tables[0];
                Session["NombreReporte"] = "rptMovimiento.rpt";
    
                X.Redirect("~/Reporte/CargarReporte.aspx", "Abriendo reporte...");
            }

    Thank you.
    Last edited by geoffrey.mcgill; Feb 12, 2014 at 7:30 PM. Reason: [CLOSED], Please use [CODE] tags
  2. #2
    Tough to say based on the limited code sample you have provided.

    Something is Null, and your code is not expecting a Null value.

    Step through the code debugging until you hit the line that is throwing the error.
    Geoffrey McGill
    Founder
  3. #3
    I said that works fine locally.

    I use this button to send value:

    <ext:Button ID="btnPrinter" runat="server" Text="<b>Imprimir</b>" Icon="Printer" Disabled="true" ToolTip="Imprime el documento de traslado"  ToolTipType="Title" >
                                            <Listeners>
                                                <Click Handler="#{DirectMethods}.Imprimir(#{Id}.getValue());" />
                                            </Listeners>
                                        </ext:Button>
    Thank you.

    Quote Originally Posted by geoffrey.mcgill View Post
    Tough to say based on the limited code sample you have provided.

    Something is Null, and your code is not expecting a Null value.

    Step through the code debugging until you hit the line that is throwing the error.
    Last edited by geoffrey.mcgill; Feb 12, 2014 at 7:07 PM. Reason: Please use [CODE] tags
  4. #4
    The code you have posted looks fine. I'm assuming "Id" is what you've set as the .ID value of a Field somewhere?

    When posting code samples in the forums, please wrap those code samples in [CODE] tags.

    Please review the following guidelines for posting in the forums:

    http://forums.ext.net/showthread.php...ing-New-Topics

    http://forums.ext.net/showthread.php...ation-Required
    Geoffrey McGill
    Founder
  5. #5
    Resolved, the dataset without data coming.

    Thank you.

    Quote Originally Posted by Quico View Post
    I said that works fine locally.

    I use this button to send value:

    <ext:Button ID="btnPrinter" runat="server" Text="<b>Imprimir</b>" Icon="Printer" Disabled="true" ToolTip="Imprime el documento de traslado"  ToolTipType="Title" >
                                            <Listeners>
                                                <Click Handler="#{DirectMethods}.Imprimir(#{Id}.getValue());" />
                                            </Listeners>
                                        </ext:Button>
    Thank you.

Similar Threads

  1. [CLOSED] DirectMethod error wrapping
    By Leonid_Veriga in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 03, 2014, 3:22 PM
  2. Replies: 1
    Last Post: Nov 05, 2012, 9:22 PM
  3. [CLOSED] DirectMethod in customcontrol error
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 22, 2012, 9:56 PM
  4. Replies: 7
    Last Post: Oct 20, 2011, 12:35 PM
  5. IDMode in a UserControl
    By David Pelaez in forum 1.x Help
    Replies: 1
    Last Post: Mar 23, 2011, 9:55 PM

Posting Permissions