Dynamically Load a user control (ascx) in a asp.net website

后端 未结 6 1319
情话喂你
情话喂你 2020-12-09 06:41

I am trying to dynamically load a user control in an asp.web site. However due to how asp.net websites projects are setup (I think), I am not able to access reach the type d

6条回答
  •  余生分开走
    2020-12-09 07:10

    Namespaces are not supported under the website model. As such, I could not get any of the solutions proposed to work. However, there is a solution. Create an interface and place it into app code and then implement the interface in the user control. You can cast to the interface and it works.

提交回复
热议问题