Access Modifier Error: Cannot specify accessibility modifiers for both accessors of the property or indexer

Last Reply on Feb 27, 2018 12:26 AM By dharmendr

Posted on Feb 27, 2018 12:20 AM

Can anyone please explain what exactly wrong in following code. and what is correct way to write it?

 

Error: Cannot specify accessibility modifiers for both accessors of the property or indexer 

  public FileUpload ucFileUpload
    {
        protected get
        {
            return this.FileUpload1;
        }

        private set
        {
            this.FileUpload1 = value;
        }
    }
    public HiddenField ucHiddenContainer
    {
        protected get
        {
            return this.hfContainerNo;
        }

        private set
        {
            this.hfContainerNo = value;
        }
    }
This question does not have replies that have been liked.