ASP.NET user control with a user control generates a null reference

This should be a common problem.

  • User Control A has a TextBox T.
  • User control B inherits from user control A.
  • User control B is on page P.

During the Page_Load event of page P, if you try to access the TextBox T, you will find it null.

Is there an elegant solution for this?

+3
source share
2 answers

UserControls UserControls . UserControl - TextBox null.

UserControl A, UserControl B, - UserControl A UserControls.

UserControls - ( ) ASP.NET UserControl UserControl?.

+7

B BSC ASCX T? , T . B T, , , , , .

+1

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


All Articles