Click here to Skip to main content
15,887,485 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Well, at least they use SQL Server Pin
kmoorevs20-Apr-19 12:33
kmoorevs20-Apr-19 12:33 
GeneralRe: Well, at least they use SQL Server Pin
Slacker00722-Apr-19 21:55
professionalSlacker00722-Apr-19 21:55 
GeneralRe: Well, at least they use SQL Server Pin
Brisingr Aerowing20-Apr-19 12:48
professionalBrisingr Aerowing20-Apr-19 12:48 
JokeRe: Well, at least they use SQL Server Pin
Anurag Gandhi11-May-19 6:52
professionalAnurag Gandhi11-May-19 6:52 
GeneralRe: Well, at least they use SQL Server Pin
Member 1433107613-May-19 4:31
Member 1433107613-May-19 4:31 
GeneralSo we have this service at work... Pin
MadMyche19-Apr-19 5:28
professionalMadMyche19-Apr-19 5:28 
GeneralRe: So we have this service at work... Pin
Rick York2-May-19 4:44
mveRick York2-May-19 4:44 
GeneralStupid user tricks (double-click = double postback) Pin
kmoorevs18-Apr-19 12:07
kmoorevs18-Apr-19 12:07 
I've just solved an issue that has baffled me for some time. The app in question is a webforms app hosted at Azure. The issue was/is caused by the user double-click a submit button causing double-postbacks and duplicate records in the database.

The rate of occurrence was pretty low (about 10 times a week out of around 12K inserts) and really only results in a minor annoyance as the last record is the only one used moving forward. Additionally, it seemed to affect only specific individuals.

I racked my brain over this problem multiple times in the past looking for this 'bug' thinking that it might be a hiccup at the web server or a collision at the db. The customer gave me another example this morning to remind me that it was still happening. After a couple of hours of looking for the problem, I took a break. It was then that I considered that maybe they are hitting the submit button twice. At first, I dismissed the idea thinking that it shouldn't even be possible...there's been javascript there all along that should have prevented it anyway! OMG | :OMG: Then I tried it and behold, there it is! Smile | :) It just took a really fast double-click. I still wonder wtf people want to double-click in a web browser??? Confused | :confused:

Apparently, the existing javascript was only effective when I put a breakpoint in it so I think it may have been a timing issue...the second client-side click registered before the javascript (fired on-click) that was setting it's click event to false. I had to add a couple of hidden fields to actually make it work right.
"Go forth into the source" - Neal Morse

GeneralRe: Stupid user tricks (double-click = double postback) Pin
Super Lloyd18-Apr-19 12:30
Super Lloyd18-Apr-19 12:30 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
honey the codewitch18-Apr-19 12:55
mvahoney the codewitch18-Apr-19 12:55 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
grralph118-Apr-19 23:29
grralph118-Apr-19 23:29 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
OriginalGriff19-Apr-19 0:37
mveOriginalGriff19-Apr-19 0:37 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
grralph119-Apr-19 1:11
grralph119-Apr-19 1:11 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
Lutosław22-Apr-19 21:41
Lutosław22-Apr-19 21:41 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
MadMyche19-Apr-19 5:38
professionalMadMyche19-Apr-19 5:38 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
kmoorevs19-Apr-19 5:16
kmoorevs19-Apr-19 5:16 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
Brisingr Aerowing20-Apr-19 12:32
professionalBrisingr Aerowing20-Apr-19 12:32 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
kmoorevs20-Apr-19 13:02
kmoorevs20-Apr-19 13:02 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
DerekT-P12-Jun-19 9:14
professionalDerekT-P12-Jun-19 9:14 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
kmoorevs13-Jun-19 7:18
kmoorevs13-Jun-19 7:18 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
Nelek22-Apr-19 21:50
protectorNelek22-Apr-19 21:50 
GeneralRe: Stupid user tricks (double-click = double postback) Pin
David A. Gray28-Apr-19 14:52
David A. Gray28-Apr-19 14:52 
QuestionConcept of "Password Mode" Pin
Bogatitus17-Apr-19 16:03
Bogatitus17-Apr-19 16:03 
AnswerRe: Concept of "Password Mode" Pin
CodeWraith18-Apr-19 2:34
CodeWraith18-Apr-19 2:34 
AnswerRe: Concept of "Password Mode" Pin
Nathan Minier18-Apr-19 3:17
professionalNathan Minier18-Apr-19 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.