must declare in the body?

Posted on 2009-02-15
Medium Priority
Last Modified: 2012-05-06
Server Error in '/OL_Web' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0501: 'OmegaLove.Web.UI.OmegaLovePage.OmegaLovePage()' must declare a body because it is not marked abstract, extern, or partial

Source Error:

Line 7:      public class OmegaLovePage : Page
Line 8:      {
Line 9:          public OmegaLovePage();
Line 10:
Line 11:         public bool HasBasketControl { get; set;
using System;
using System.Web.UI;
namespace OmegaLove.Web.UI
    public class OmegaLovePage : Page
        public OmegaLovePage();
        public bool HasBasketControl { get; set; }
        public bool PreserveWhitespace { get; set; }
        protected override void InitializeCulture();
        protected virtual void InitializeTheme();
        //protected override void Render(HtmlTextWriter writer);
        //protected override void SavePageStateToPersistenceMedium(object state);

Open in new window

Question by:mathieu_cupryk
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 23646911
u cant have abstract methods in the class since the class is concrete.
LVL 30

Accepted Solution

anarki_jimbel earned 2000 total points
ID: 23646973
In other words you need to create a "body" for each method including constructors and also properties.


    public class OmegaLovePage : Page
        public OmegaLovePage(){
             // do some stuff to initialize your class if you need
        public bool PreserveWhitespace { 
                     return true;
                 m_preserve = value;

Open in new window


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 11 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question