Click here to Skip to main content
11,478,642 members (64,646 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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:

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 28-Aug-12 12:49pm
Edited 28-Aug-12 12:57pm
Wes Aday94.3K
v2
Comments
Christian Amado at 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 =)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,

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

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You are extending from an Event class, so this will not work. delete the RepeaterCommandEventArgs from there.

What are you trying to do?
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 209
1 F-ES Sitecore 170
2 Frankie-C 120
3 OriginalGriff 105
4 DamithSL 95
0 Sergey Alexandrovich Kryukov 7,865
1 OriginalGriff 7,341
2 Sascha Lefèvre 3,059
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100