Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Who needs event handlers...

Who needs event handlers...

Scheduled Pinned Locked Moved The Weird and The Wonderful
database
3 Posts 3 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FyreWyrm
    wrote on last edited by
    #1

    ...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 If

    End 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.

    A M 2 Replies Last reply
    0
    • F FyreWyrm

      ...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 If

      End 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.

      A Offline
      A Offline
      Anton Afanasyev
      wrote on last edited by
      #2

      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:

      1 Reply Last reply
      0
      • F FyreWyrm

        ...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 If

        End 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.

        M Offline
        M Offline
        Mustafa Ismail Mustafa
        wrote on last edited by
        #3

        :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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups