How do I reference an ASP.net MasterPage from App_Code

后端 未结 3 1376
暖寄归人
暖寄归人 2020-12-18 10:16

I\'m working on a .net 3.5 site, standard website project.

I\'ve written a custom page class in the sites App_Code folder (MyPage).

I also have a master page

3条回答
  •  伪装坚强ぢ
    2020-12-18 10:25

    I found some background to this, it happens because of the way things are built and referenced.

    Everything in App_Code compiles into an assembly.

    The rest, aspx files, code behind, masterpages etc, compile into another assemlby that references the App_Code one.

    Hence the one way street.

    And also why Ben's solution works. Thanks Ben.

    Tis all clear to me now.

提交回复
热议问题