Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
What's the problem in that code this code is working in Development but when i try to put that page in Live it shows the error
AData.A0.get' must declare a body because it is not marked abstract or extern


C#
public class AData
    {
        public int A0 { get; set; }
        public int A1 { get; set; }
        public int A2 { get; set; }
        public int A3 { get; set; }
        public int A4 { get; set; }
    }
    List<AData> grid2Data = new List<AData>(); 


Page_load

if (!IsPostBack)
        {
          
            grid2Data.Add(new AData() { A0 = 0, A1 = 0, A2 = 0, A3 = 0, A4 = 0 });
        }   


can anyone help me to solve this issue...


thanx in Advance...
Posted

I never so such thing, but I have a strong impression that this is because "in Live" an outdated C# compiler is used, the one prior to v.3.0, when auto-implemented properties were introduced:
http://msdn.microsoft.com/en-us/library/bb384054.aspx[^].

If this is C#2.0, it's still maybe not too bad (generics and anonymous types were there, and this is already good, and one can live without lambdas and syntax improvements, and WPF is not used in ASP.NET). However, if this is something prior to v.2.0, it means some version of .NET which I personally don't even consider as "real". Yes, at that time we already had fully functional .NET, but too me, it's quality was more of a pre-release. No, first decent .NET was v.2.0.

Please check it up. If this is really the case, there are two solution: 1) use hosting where the newer software is used, 2) work-around to comply with C# 2.0 syntax.

In your case, the work-around may look like this:
C#
public class AData {
   public int A0 { get { return a0; } set { a0 = value; } }
   inf a0;
   //...
}


—SA
 
Share this answer
 
C#
Automatic properties did not arrive in visual studio until VS 2008 (c# 3.0).  You need to do it the old way in VS 2005:


private int _x, _y;
public int X {get {return _x;} set {_x = value;}}
public int Y{get {return _y;} set {_y = value;}}


Else check your app pool or webconfig which should support this dotnet framework
 
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