PageIsPostBack or IsPostBack

I just wanted to know that there is a performance difference between the two statements

Page.IsPostBack

or

IsPostBack
+3
source share
5 answers

There will be a difference at the IL level (an additional getter call in the first case), but it will be so insignificant that you should not worry at all.

+5
source

There is no practical difference. The property Pagesimply provides a reference to the same instance as this.

+3
source

.

IsPostBack Page. "IsPostBack".

Control, Page. , , .

+2

. . .

+1

IsPostBack.

Control , , , . . ASP.NET Control, , .

, , , . .

, "this" Page. .NET, IsPostback , this.IsPostback. , .

IsPostBack is significantly faster and consistent with what you do in all other classes. Page.IsPostBack implies that magic happens.

0
source

All Articles