r/web_programming • u/RandomGuyB1010 • May 05 '16
Quick question about C# Web Forms
Hey guys, I've got a simple thing to do - implement the login form. My employer wants me to use Web forms and my stubborn ass want's to implement the MVC pattern (I already have). The problem is I have no idea how to instantiate the Controller. I run debugging, get the view, but since there is no controller (or model), nothing happens when I click login since no one can respond to the event.
TLDR: I know there is the MVC form, but I wonder can I do MVC in Web forms
3
Upvotes
2
u/[deleted] May 05 '16
If you want a controller you need to write your own. Have the event on the form stuff the forms contents into a dto and send them to the controller with the event name . Coming back out, have the controller package the view data in a dto and then have the page map it to the controls. Have the controller do server transfers to switch pages. Pain in the assembler.