ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Access Modifier Error: Cannot specify accessibility modifiers for both accessors of the property or indexer <p>Hi <a class="username" rel="Gayatri">Gayatri</a>,</p> <p>As the error states that you Cannot specify accessibility modifiers for&nbsp;accessors of property. So change your code with below.</p> <pre class="brush: csharp">public FileUpload ucFileUpload { &nbsp;&nbsp;&nbsp; get &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.FileUpload1; &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; private set &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.FileUpload1 = value; &nbsp;&nbsp;&nbsp; } } public HiddenField ucHiddenContainer { &nbsp;&nbsp;&nbsp; get &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.hfContainerNo; &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; private set &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.hfContainerNo = value; &nbsp;&nbsp;&nbsp; } }</pre> <p>Only one accessor can be modified.</p> <p>For more details refer below link.</p> <p><a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/restricting-accessor-accessibility">https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/restricting-accessor-accessibility</a></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/269418/Access-Modifier-Error-Cannot-specify-accessibility-modifiers-for-both-accessors-of-the-property-or-indexer/https://www.aspforums.net:443/Threads/269418/Access-Modifier-Error-Cannot-specify-accessibility-modifiers-for-both-accessors-of-the-property-or-indexer/Tue, 27 Feb 2018 00:26:22 GMT