Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hola amigos, estoy empezando en la programacion C# asp.net y tengo este problema que ya me esta quitando mucho tiempo, y creo que para alguno de ustedes debe ser de lo mas sencillo de resolver.

Me esta generando el error en "public repeaterCEA(int idLote)" que dice "System.Web.UI.WebControls.RepeaterCommandEventArgs no contiene un constructor que tome 0 argumentos.

El codigo es el siguiente:

C#
namespace SIISA.Controls.lotes
{
    public partial class ctrListaLotesConsolidados : System.Web.UI.UserControl
    {
        public delegate void RepeaterCommandEventHandler(repeaterCEA e);
        public event RepeaterCommandEventHandler RepeaterSelectedAction;

        public class repeaterCEA: RepeaterCommandEventArgs
        {            
            public Int32 idLote { get; protected set; }

            public repeaterCEA(int idLote)
            {
                this.idLote = idLote;
            }            
        }       
    }
}

Espero que me puedan ayudar,

Gracias de antemano.

Hello friends, I'm starting programming in C # asp.net and I have this problem that is keeping me awake a long time, and I think for any of you should be very simple to solve.

I is generating the error "public repeaterCEA (int idLote)" that says "System.Web.UI.WebControls.RepeaterCommandEventArgs not contain a constructor that takes 0 arguments.

The code is as follows:
Posted
Updated 28-Aug-12 11:57am
v2
Comments
Christian Amado 28-Aug-12 19:44pm    
Hola que tal? En este sitio sólo escribimos en ingles. Hi How are you doing? In this site we just write in English =)

Hi,

When you have class with parametrized construction it must have default constructor in it. So your code should be like,

C#
public class repeaterCEA: RepeaterCommandEventArgs
        {
            public Int32 idLote { get; protected set; }
            // Default constructor added.
            public repeaterCEA() 
            {}
            public repeaterCEA(int idLote)
            {
                this.idLote = idLote;
            }
        }


Hope you got it.

Thanks
-Amit Gajjar
 
Share this answer
 
You are extending from an Event class, so this will not work. delete the RepeaterCommandEventArgs from there.

What are you trying to do?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900