I am new to .net. Why we are using web server control access modifier as
protected instead private (even we are using private in winforms control)?
Hi Selvakumaranj!
I believe that it's because you need to allow partial controls to access these variables/functions.
Could you please use a more descriptive title in your future posts.
"Hi there" is not very descriptive and does not reflect the problem that you are facing. I am changing your title so that it is more meaningful. Please review the posting guidelines, specifically the section on Use a good thread title for more information on why this is important.
I believe that it's because you need to allow partial controls to access these variables/functions.
Could you please use a more descriptive title in your future posts.
"Hi there" is not very descriptive and does not reflect the problem that you are facing. I am changing your title so that it is more meaningful. Please review the posting guidelines, specifically the section on Use a good thread title for more information on why this is important.
Thanks
-Frinny
Thanks for your reply. From now onwards i will use descriptive title.
While declaring controls In Winforms:
private System.Windows. Forms.Button button1;
In webforms:
protected System.Web.UI.W ebControls.Butt on Button1;
why?
Thanks for your reply. From now onwards i will use descriptive title.
While declaring controls In Winforms:
private System.Windows. Forms.Button button1;
In webforms:
protected System.Web.UI.W ebControls.Butt on Button1;
why?
This has to do with letting the ASP code call the Server Side code for the button. If it were private, then the ASP code would not be able to access it.
This has to do with letting the ASP code call the Server Side code for the button. If it were private, then the ASP code would not be able to access it.
Comment