We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


must declare in the body?

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

Watch Question


u cant have abstract methods in the class since the class is concrete.
Senior Developer
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.