Access specifier for method
-
Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti
-
Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti
If you want to access the method from your html page, you need to make it at least Protected. I mean if you write
<asp:textbox OnClick="txt_Click" runat="server" />
the txt_click should be made at least protected. Privates cant be used in events. If you are just calling the method from the class itself, you can use Private. :rose:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti