Best way to access properties of my code behind class from the markup in ASP.NET

前端 未结 5 1298
攒了一身酷
攒了一身酷 2020-12-14 02:50

This might be a really dumb question but I\'m learning .NET, so I\'m quite clueless...

Let\'s say I have two files default.aspx and the associated default.a

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 03:37

    Doesn't it have to be public to be accessible in that scope?

    ..

    public var myObject = null;
    protected void Page_Load(object sender, EventArgs e)
    {
      myObject = new Object();
    }
    

提交回复
热议问题