Home > Net >  Why when I was at the front desk to invoke the background variables: the current name context does n
Why when I was at the front desk to invoke the background variables: the current name context does n

Time:11-15

I have the following code in the background in the Page_Load:

String TMP="aaa";

At the front desk want to show that, with the following code:

& lt; % %=TMP & gt;

There is no name but tip: the current context "TMP"

CodePudding user response:

Variable private by default, the front desk can't access, you need to change to protected string TMP="aaa"; Or public string TMP="aaa";

CodePudding user response:

Have a good look at the life cycle on the article, you will know.

CodePudding user response:

In the background to define variables as public

CodePudding user response:

Public string TMP so defined
  • Related