Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3319334
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:48:45+00:00 2026-05-17T22:48:45+00:00

For some reason, I am having issues with Interfaces. I know a 100 examples

  • 0

For some reason, I am having issues with Interfaces. I know a 100 examples have been posted but apparently I’m not smart enough to figure it out…

I have the following interface:

namespace DocStore.Interfaces
{
  public interface IResetCategoryControl
  {
    string CategoryToAdd { set; }
  }
}

I want to set CategoryToAdd to a value.

Here is my class that I want to set it in and what I have so far:

  public partial class AddDocumentsDialog : IResetCategoryControl

    public string CategoryToAdd
    {
      set
      {
        IResetCategoryControl() ireset = new IResetCategoryControl();
        ireset.CategoryToAdd = value;       
      }
    }
  }

What am I doing wrong in the AddDocumentDialog class? I can’t get that part to work.

Thank you!

Eroc

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:48:45+00:00Added an answer on May 17, 2026 at 10:48 pm

    Following line is the problematic one:

    IResetCategoryControl() ireset = new IResetCategoryControl();
    

    First, you need to get rid of first parenthesis:

    IResetCategoryControl ireset = new IResetCategoryControl();
    

    Next, you cannot instantiate an interface. Interface is only a signature which has to be implemented by a concrete class.

    If you are looking at some other people’s code, right click on IResetCategoryControl and select “Find all references” to search if this interface has already been implemented in some class.

    For example, you may find:

    class SomeResetCatControl : IResetCategoryControl 
    {
    
    }
    

    On the other hand, it looks like you only need to set an internal private field in your setter method. You should do it like this in that case:

    public partial class AddDocumentsDialog : IResetCategoryControl
    {
       private string _categoryToAdd = "";
       public string CategoryToAdd
       {
         set
         {
            _categoryToAdd = value;
         }
       }
    }
    

    But as others have already pointed out, using a write-only property is very unusual, and indicates wrong design.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I having issues exporting a GridView to Excel for some reason. I have two
I've been having issues with using templates for a vector class. For some reason
This should'nt be that difficult but for some reason i'm having trouble with this.
Kick me if I'm being silly but some some reason I'm having a heck
My Javascript is quite basic, but for some reason I am having trouble. I
This is almost certainly a very silly question, but for some reason I'm having
Im still having issues using HttpWebRequest . For some reason sometimes in my app
Having some issues with code not executing within the classes I created and thought
I am having issues with this code: For some reason, it always fails to
I'm trying to get lein up and running. But for some reason I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.