I'm trying to fire one event for all ASP.NET pages.
I don't want to duplicate this in all pages. So is there a way to do so for all pages ?
It might be available in web.config ?

My goal is to translate all pages before send to client.
So keep in mind I can't use events before Rendering because the controls texts are unknown.
Also we can't use events after Unload because we have no permission to write stream after this.

If you really need to fire method for each page, try binding to one of events handled by MasterPage. Here is an ordered list of events fired by content pages and Master page.

If you won't be able to achieve what you want to do with Master page, you can try creating new page that inherits from System.Web.UI.Page, defind the behaviour in this page, and then make all other pages to inherit from this page and not from System.Web.UI.Page directly.

i don't want to use resources since that won't help me.
–
MahdiFeb 11 '13 at 12:14

@Namemustbeatleast3char Why do you need to translate controls using separate function? I don't understand why not use resources.
–
Konrad GadzinaFeb 11 '13 at 12:17

Because actually this is not a translation. it was just an example
–
MahdiFeb 11 '13 at 12:20

@Namemustbeatleast3char As you can see that example is a bit confusing - you should write what exactly you want to do to allow us to post answer that really fits your needs. Check my updated answer.
–
Konrad GadzinaFeb 11 '13 at 12:30

Thanks your updated answer is the only way to achieve what I want.
–
MahdiFeb 11 '13 at 12:34