Click here to Skip to main content
15,394,700 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DevExpress.AspNetCore.RichEdit;
using DevExpress.AspNetCore;
using DevExpress.Web.Mvc.UI;
using DevExpress.Blazor.RichEdit;
using System.Runtime;

namespace TextEditor.Pages
{

    public static RichEditBuilder  RichEdit(
        this BuilderFactory factory,
        string name
    );
}


Error	CS1106	Extension method must be defined in a non-generic static class	
Error	CS0116	A namespace cannot directly contain members such as fields or methods
Error	CS0501	'<invalid-global-code>.RichEdit(BuilderFactory, string)' must declare a body because it is not marked abstract, extern, or partial	TextEditor	

this error are caused in RichEdit




What I have tried:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DevExpress.AspNetCore.RichEdit;
using DevExpress.AspNetCore;
using DevExpress.Web.Mvc.UI;
using DevExpress.Blazor.RichEdit;
using System.Runtime;

namespace TextEditor.Pages
{

    public static RichEditBuilder  RichEdit(
        this BuilderFactory factory,
        string name
    );
}
Posted
Updated 10-Jan-22 4:11am

1 solution

You have declared a function outside of a class. You cannot do that in C# - all code must be within a class.

You have also forgotten to provide a method body.
C#
namespace TextEditor.Pages
{
    public static class RichEditExtensions
    {
        public static RichEditBuilder RichEdit(
            this BuilderFactory factory,
            string name)
        {
            // TODO: Implement the method
            throw new NotImplementedException();
        }
    }
}
But this raises the question of why you are trying to implement a method which the DevExpress framework already provides for you?
BuilderFactoryRichEditExtensions.RichEdit(BuilderFactory, String) Method | ASP.NET Core Controls | DevExpress Documentation[^]
   
Comments
Rain Nature 10-Jan-22 11:30am
   
Thankyou Sir, for your answer. Its work for me, coming to your question that i have try to create a mvc richtext editor because i cannot able to access save dialog box in blazor devexpress like a microsoft word document. but still now i don't know mvc so iam struggling with it and still now i can't get richtexteditor i have a blank page as output so i tried to implement this code

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