Ricky
Ricky

Reputation: 35853

When would InitializeCulture be called

I found many pages of my maintenance website inherits a base page which overrides InitializeCulture to customize some globalization settings.

Is this method called every time for any incoming request?

Upvotes: 4

Views: 3198

Answers (3)

Marcel
Marcel

Reputation: 15722

Yes, and for each BrowserLink update too, as I have just found out. (Using Visual Studio 2015 and Google Chrome today.)

It this annoys you, you can disable Browserlink.

Upvotes: 0

Frug
Frug

Reputation: 448

Yes, if InitializeCulture is called on a base page it will be called on every page that inherits that base page and on every incoming request.

You can always try putting a line like: HttpContext.Current.Response.Write("intializing culture"); Inside the function call. It will appear at the top of every page that inherits the class to prove to you that it's always being called.

Upvotes: 1

John Christensen
John Christensen

Reputation: 5030

According to http://msdn.microsoft.com/en-us/library/system.web.ui.page.initializeculture.aspx it's going to get called very early (like, even before controls are added early) in the page-initialization process. So yes, it would be called each time an aspx page that derives from your base page is requested.

Upvotes: 4

Related Questions