开发者

what is the default access modifier for controls created on .aspx page. Private or something else?

What is the default access modifier for controls created on .aspx page. Private or something 开发者_如何学Celse?


its 'protected'.

N


protected

If you open the MyPage.aspx.designer.cs (or MyPage.aspx.designer.vb) you can see the declarations for the controls.


I believe the controls on the aspx as considered protected by default and any methods in the code behind (.aspx.cs or aspx.vb) are private by default. You can expose those controls by adding a public page property if you need to access it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜