Wow - 2 years since i made a post on here!Oops. Guess i've been a little busy.
Anyway - i thought i just had to post this little nugget as it had me head scratching for a while.
You my be looking for a solution to any of the following:
Handling unchecked checkboxes on form post
Checkboxes missing from postback in asp.net web forms
Checkboxes missing from form on postback
or something of a similar ilk! Chances are its probably the same issue.
Except its not an issue - it seems its by design unfortunately. No idea who made this decision but when a checkbox is not checked it is not posted back to the server in a form post!
I came across this because i was dynamically building the form and populating a database from what came back and stuff wasnt getting updated when i unticked the checkboxes.
After a lot of debugging trying to suss the problem i discovered the issue as outlined above.
Anyway to cut to the chase... the way to solve this - or at least how i solved this was to add a hidden field with the same NAME (not ID) just before the checkbox.
To set the name you will have to do a little messing about as its not a property on the server control. My situation was unique as i had the controls on a user control so i took the UniqueID of the usercontrol, replaced the separator '_' with the ClientIDSeparator '$' and then added $checkboxname to the end.
The next thing you will have to do is remove a comma ',' from the value in the form as multiple items with the same name create an array of controls on the form that all get placed into the value.
So just strip that out and you should now get a form item with the name of the checkbox as an empty string even when the checkbox is unchecked!
Hope you understand that. Like i said my situation was unique so i cant really drop source code in but if you need any help with your situation then add a comment and i'll try to help.
Friday, 9 November 2012
Handling unchecked checkboxes on form post
Posted by
Omen
at
16:14
0
comments
Labels: ASP.NET, Web Development

Sunday, 4 October 2009
Have You Ever Thought of Making Money Online Utilising Your Existing Development Skills?
As you are a reader of this blog then there is a pretty good chance you have some involvement with software development or web development. If not, don't worry as it may be very useful for you too.
What I would like to know is have you ever asked yourself the question:
"What if there was a way for me to earn some extra money online utilising my existing skill set?"
As you already probably realise there are hundreds upon thousands of people making a living online. You may therefore be quite surprised that a lot of these people are doing nothing more than blogging and building lists of readers in order to do this.
Surprised? - I was!
Assuming you are a developer or techy person of some sort, I would like to maybe open you eyes to the surprisingly simply ways to making some extra money online doing nothing more than simply utilising what you already know AND by using totally free methods.
Many people making money online often started out with zero knowledge about the Internet and many of them still have a very small amount of knowledge about its actual 'workings'. Coming from the techy side of things you will already have a massive leg-up in the knowledge stakes. All you need to do is learn how to leverage those skills to make money online.
There are many ways to make money online and these are the key business models as I see it:
1. You do work for someone to provide a service such as creating a website, artwork, software etc.
2. You sell/promote other peoples product and take a cut of the commission when it sells (this is affiliate marketing).
3. You put things such as AdSense and banners on your website to drive traffic to other peoples websites.
4. You train people to be able to do things themselves to learn how to work online (coaching)
5. You sell your own product or service online.
Personally, I have focused on affiliate marketing and AdSense and have experienced varied levels of success. It is also these two areas that I feel you should really look into too!!
Over a period of several months I had been trying to get my head around it all in between my day job and hectic life but it was not until recently that I actually 'got it' and things started clicking into place. The person I have to thank for this is David Bocock.
Until 2 months ago I had never heard of David and I actually came across him by accident whilst reading some Internet marketing forums.
I had already tried several courses (unsuccessfully) and although I understood what it was telling me I had trouble joining the dots so to speak. I was getting really fed up with trying to make things work and decided to give David a shot as my last chance saloon. All I can say is I am so glad I did.
David'd course is so cheap (just $29) I can't get over how good it is! The value for money is simply amazing. For less than the price of good self teach book he provides over 15 hours of video training - and this is constantly expanding as he adds new ones. You are taken from the basics all the way through everything you need to know.
You may still be wondering how this could possibly benefit you? Well just imagine for a moment what learning these simple techniques to do for you? What could a bit of extra cash a month help with? Money towards bills? Eating out at a nice restaurant? Funding a deposit on a new car or house? The possibilities are endless.
You may be thinking you already have a decent income and don't need to do this. Well I can understand you feeling that way but what if I told you that from applying just ONE of the simple techniques I learnt in David's course to a blog that I own I am now making 8-10 sales per month consistently from a single blog post? This is now running on auto pilot and will do for the foreseeable future.
Those sales are now paying for my car and home insurance. That money is now freed up to be used for other 'fun' things. Just from doing something that took approximately 15 mins I utilised something I already had and monetised it. I was blown away when it worked. :o)
So, here is the bottom line. If you would like to make some extra easy cash from your existing skill set then go and take a look at David's Internet Marketing Course. The course is also backed with a money back guarantee so there is absolutely nothing to lose from trying it. The choice is yours!
So to finish - David, if you happen to be reading this, then thank you for creating your course - its wicked! :)
Posted by
Omen
at
15:32
0
comments
Labels: internet marketing, Web Development

Wednesday, 22 July 2009
Error: Lightbox is 'undefined' when using Lightbox from Flash on IIS
Today I came across an issue with Lightbox (the javascript image gallery) and after ages of trying to find out what it was everyone seemed to be saying the problem was in the JavaScript and how it was called.
The thing that made me think otherwise was the exact same website was working perfectly on another server which was Linux. After looking around the code I noticed the lightbox file was called lightbox++.js
Every time you clicked on an image in the gallery I got the Error: Lightbox is 'undefined' and in FireFox - 'Lightbox is not defined.
On a hunch i tried entering the path in the lightbox.js file into the address bar and IIS said the file didn't exist! I then had a lightbulb moment.
IIS doesn’t seem to like the + character in the lightbox++.js file name and wouldn’t serve up the file so I renamed to lightbox.js and updated the reference in the calling page and bingo! It works fine.
So if you get the Error: Lightbox is 'undefined' message and are using a Windows server and IIS then don't use + in the file name!
Posted by
Omen
at
17:01
5
comments
Labels: IIS, Lighbox, Web Development
