1

Can we write all the control events in a seperate class file in different layer rather than in code-behind of web-page ? Kindly help.

Thanks in advance.

HotTester
  • 5,620
  • 15
  • 63
  • 97
  • 2
    What you want is called [ASP.NET MVC](http://www.asp.net/mvc). With web-forms you could achieve what you want, but it won't be pretty. – SWeko Nov 16 '11 at 09:49
  • We are trying to separate the UI layer with code-behind logic. UI layer would only have UI and client side validations, while all the logic would be there in seperate EventManager layer. – HotTester Nov 16 '11 at 09:50
  • I tried to achieve it by partial classes but partial classes work only if they are in same namespace. – HotTester Nov 16 '11 at 09:52
  • @HotTester ASP.Net MVC is designed to separate UI layer from "business logic" – MarkJ Nov 16 '11 at 12:04

1 Answers1

1

Yes you can. One way of doing that is to make a partial class with the same name as your codebehind file and use that to contain the events.

Illuminati
  • 4,539
  • 2
  • 35
  • 55