Dynamically loading custom controls in a C # web application, not a website

I am trying to create my own site management structure similar to DNN / SiteFinity (short version only).

One of the big (but common) features is the ability to dynamically add custom controls to provide additional functionality.

I would prefer to use a precompiled .NET application based on a dynamically compiled "Website".

What are the implications of using the LoadControl method to dynamically add a custom control for precompiled web applications, with particular regard to:

  • Session (assuming I'm using a state server)
  • What happens to all other users - will they log out?
  • Utilization of application pool due to changes in some compilation

I'm not sure I have ever dynamically added a user control to precompiled web applications, since I mainly use "Websites", so I make a big presumption that it will work, because if the site is precompiled Does this mean that a dynamically added user control will be dynamically compiled as needed, even if the site is precompiled?

EDIT

I also forgot to mention that user controls will be outside the application directory and therefore will not be published during web deployment - they will be downloaded through another website.

! .

+3
2

-.

:

, ClientID. ( .) - " ". , , , . , "TextBox1" UserContro l "UserControl1" : UserControl1_TextBox1.

Post back ClientID. , TextBox's , Request.Forms["UserControl1_TextBox1"]. , , UserControl , ClientID? .

:

  • UserControl ID.

  • , postback . . ViewState ViewState.

  • , Post_Back, LoadControl, UserControl. false, .
+1

Source: https://habr.com/ru/post/1782367/


All Articles