must declare in the body?

Posted on 2009-02-15
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
    u cant have abstract methods in the class since the class is concrete.
    LVL 29

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now