Who needs event handlers...
-
...do it all in Page_Load! My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd... (Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad
' create some objects, initialize some variables
If Page.IsPostBack
' validate the user input
ValidateInput()
' save the user input to the database
SaveInput()
End IfEnd Sub
Farther down in the code I find this...
Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick
' direct the user to the new page
Response.Redirect(page.aspx)End Sub
:wtf:
Smile and the world smiles with you. Laugh and the world thinks your insane.
-
...do it all in Page_Load! My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd... (Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad
' create some objects, initialize some variables
If Page.IsPostBack
' validate the user input
ValidateInput()
' save the user input to the database
SaveInput()
End IfEnd Sub
Farther down in the code I find this...
Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick
' direct the user to the new page
Response.Redirect(page.aspx)End Sub
:wtf:
Smile and the world smiles with you. Laugh and the world thinks your insane.
I feel your pain there. I'm working on a website right now, and the framework we are using to build it - all its samples, all the pages that are there to build upon - not a single event handler. All postbacks and redirects. Sometimes it makes me want to puke :sigh:
:badger:
-
...do it all in Page_Load! My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd... (Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad
' create some objects, initialize some variables
If Page.IsPostBack
' validate the user input
ValidateInput()
' save the user input to the database
SaveInput()
End IfEnd Sub
Farther down in the code I find this...
Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick
' direct the user to the new page
Response.Redirect(page.aspx)End Sub
:wtf:
Smile and the world smiles with you. Laugh and the world thinks your insane.
:omg::wtf: And this guy still lives?!!!!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook "There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib