Friday, 9 November 2012

Handling unchecked checkboxes on form post


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.


Thursday, 11 November 2010

My Idea for Microsoft Kinect - A Virtual World Just Like Lawnmower Man

Remember the film Lawnmower Man where the guy went into a virtual world? See the bottom of this post for the trailer. Well maybe Microsoft Kinect could fetch something like this to the masses.

I've been having a think about the sort of games that could work well with this technology and when you think about how it can recognise you and your voice, understands depth, motion and your mood etc. then why not create a virtual world.

Everthing I have seen up to now has involved everyone jumping up and down infront of the TV. But what if you put on a set of TV glasses and the Kinect placed you in the center of the game? If you held your hand up infront of your face Kinect could show your hand right there infront of you via the screen! Freaky! :o)

Developers etc will obviously have to get to grips with the platform but wow this thing could be huge. You could interact with people/characters/other players on xbox live right there in the game all in a virtual world.

You could also use the platform to create your own 'self' in someone elses system over xbox live for video/face to face chat! This again will be amazing but freaky but I can see it happening.

And how about a good old punch up game where you actually have a ruck with your friends in this virtual world. I dont know the quality of the depth sensor to be able to make out facial features but with some image wizardry im sure a half decent image of a person coudl be overlayed onto the virtual person.

I do wonder about safety though if you start wearing glasses and wondering aroudn this virtual world. A shin into a non virtual coffee table wouldn't be too clever.

I've not got the new Kinect yet and think it will go on the xmas list. I was quite excited by the Natal videos several months ago but had forgotten about it really since. However after looking at it more today im quite looking forward to having a play and seeing just where this puppy goes! Looking at the messages on twitter and facebook it seems people are giving it the thumbs up!

I know one thing for sure anyway... it wont be difficult to lay your hands on a Wii this xmas! They will be ten a penny on fleabay!

Anyway - heres lawnmowerman which was a pretty good film at the time....

Monday, 9 August 2010

ASP.Net Web Form Routing - Routing Problem

I have put together a web application project that made use of ASP.Net web form routing but I had some strange behaviour on a certain route.

The route i had added to the routes tables was:

routes.Add("Admin", new Route
("Admin",
new PageRouteHandler("~/Admin/help.aspx", true)));

This was to point to a the help.aspx page in the admin folder.

The Problem

When i attempted to browse to this route -

domain.com/admin

Symptoms

Rather than the page all i got was a directory listing in the web page.

Workaround

It appears the routing engine doesnt like a route value to have the same name as the folder it is pointing to.

All I had to do was rename the folder (or route value eg. domain.com/admin/help) and it all started working again.

Im not sure if this is a bug or a feature!

Please post a comment if you know what thy happened.

Thanks

Friday, 16 April 2010

Visual Studio 2010 Finally Released

So Visual Studio 2010 has finally been released. I downloaded our MSDN copy yesterday so today I will be installing in the background while i get on with other stuff - it looks a monster install!

Big thumbs up to the change in versions! What used to be multiple versions to purchase (Architect, Tester, Database, Developer) are now wrapped into Ultimate for us Team Edition users!

I'll let you know how I get on with it as I look at all the new goodies.

Just one last thing - I often recommend LearnVisualStudio.net not only as I am a very happy lifetime member and affiliate but because I truly believe you get a lot for your money - especially if you are just starting out - its where I started out and still keep going back for their new videos.

Anyway back to my original point - they have gone away and re-done their entire Visual Studio for Beginners library for Visual Studio 2010. That is 72 new videos! If you are looking to get the complete training package for peanuts then look no further!

BC30456: 'Title' is not a member of error in ASP.Net

If you get this error when you deploy to a production server but it works ok in development then the cances are you have got a duplicate name issue! This generally occurs when you have a developer that may have copied a web form rather than create a new one.

To resolve the issue simply rename the partial class (name of the underlying .vb or .cs class) and ensure that the inherits from in the aspx matches.

Golden rule is do not copy pages - create anew page and then copy the code! Or look at why you are copying - could you create a re-usable user control for example!?

Thursday, 4 February 2010

Restricting Website Access By IP Address in IIS7 - IPRestriction Module

In IIS5 and IIS6 it was pretty straight forward to control access to a website using the directpry security and adding rules into the IP Access Rules.

I came to do this on IIS7 today and it took me a good half hour to find out how to do it so here is a quick run down!

First off you need to enable the IPRestriction module by going into the server roles and adding it.

Next restart your IIS administration console (as the new module doesnt seem to appear until you do).

Next reopen your IIS7 admin console and select the website you want to apply the restriction.

Select the IP4 Address and Domain restriction module.

Add the IP address you want to allow/deny.

IMPORTANT - next you need to set the default rule to apply to unspecified clients.

Simply right click in the IPRestriction module where you added the IP address and select edit feature settings. From there set the default rule to deny if you want to restrict all IP's apart from the ones you specified.

And that is job done!

IIS7 does seem to mash ones head in a bit until you get your head around how it all hangs together.

Wednesday, 4 November 2009

Learn How to Write an iPhone App the Easy Way


Learn How To Develop an iPhone App
Have you ever thought about writing an iPhone application? If so then today I came across an excellent how to write an iPhone app ebook that takes you through all the stages of developing an iPhone application from start to finish.

The Apple iPhone App Store and its Apps are one of the hottest things in early adoption technology at the moment. People have been making an absolute killing writing simple fun applications such as iFart (that simply makes a farting sound when you press a button) and achieving something half as popular would be amazing.

Just imaging coming up with a an idea for a very simple but fun app and you spend a few evenings putting it together and then get it uploaded to the app store. Two weeks later it gets a few mentions on some techy forums and before you know it the app has gone viral! It sells for 99c and you make a small amount for each sale but the sales are going crazy. Before you know it each of those little pieces is amounting to a nice little earner.

That is just a pipe dream but it shows what is possible with a good idea and a bit of luck. I am definitely going to get started on learning how to develop applications for the iPhone and the ebook looks to take away the pain of starting from scratch on your own.

I'll keep you posted how I get on with my iPhone app development and I will be making it one of my lifes challenges to get an application on the app store!

If you are starting out in iPhone development please leave me a message and let me know how you are getting on! I'd love to hear from you - good or bad.

Friday, 23 October 2009

American airlines wifi promotion code for gogo wifi internet

If you are flying on american airlines before new years eve 2009 and the plane has wifi you should be able to use this promotion code to get free wifi on a mobile device. I dont think it works for laptops but you can try it. I used it via my iphone.

Its fantastic being able to fly and surf! In fact i am flying right now as i post this blog entry! :-)

here is the code folks! Enjoy....

MOBILE2009AA

Monday, 12 October 2009

My blog makes the mile high club!

I am blogging 35,000 feet above Chicago on my iphone using wifi internet on an american airlines flight to San Diego from Chicago. I must say its fantastic and its just like when you got to send your first ever email for some reason. Its a bit of a novelty but pretty soon I'm sure all planes will offer it. Best of all its free at the moment as a trial.

The price going forward looks to be $7.95. If i was on a long flight its deffo a great time killer to ease the boredom! This is the second part of our journey from the UK. I wish we had it coming over the pond! 8 hours is a drag.

I even tried a skype call. We managed a few words but it kept dropping out. Not to worry though because the Internet flies!

Off to try some YouTube streaming now!!! :-)

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! :)

5 Visual Studio 2010 New Features You Will Find Handy

Below are five Visual Studio 2010 new features that I feel are excellent additions to the product. On the whole I don't think the release is a massive revamp (apart from the user interface being redeveloped using WPF). It is more an enhancement of what was there before with some nice bells and whistles added in.

1. Multiple Config Files

I think one of the handiest new features is the ability to have multiple configuration files for different deployments! I currently find it a massive pain in the ass to have to maintain or update the config based on the deployment - LIVE and DEV for example. It is so easy to miss something - especially if someone else is performing an update to an unfamiliar or inherited system.

2. Detachable Code Windows

The ability to drag code windows from the main Visual Studio Interface and onto another monitor for example. This means you can work on multiple code windows at once if you have more than one monitor! A great little productivity enhancement.

3. Variable Highlighting

On selecting a variable in your code all other instances of that variable are highlighted. This speeds up finding things and therefore readability.

4. Change Tracking

This is just like in Word when you switch on change tracking / revisions. If you make a change to an area of code you are given the solid line at the edge of the code window. This is very helpful to show you where any modifications have been made to code.

5. Historical Debugging

Historical debugging is a very nice feature! Switching it on will make things slower but if you are looking for a needle in a haystack when searching for a bug - especially if you were debugging events for example then this feature will prove invaluable.

What it basically does is record your execution path and call stack etc and if your program falls over you can simply go back through the recording to show what happened and where. This eliminates having to set breakpoints etc. and re-run the code. Nice!!

I am sure there are a ton more handy little tweaks but these are just 5 I have liked so far.

Visual Studio 2010 Download and Video Training

If you are like me and are itching to get hold of the Visual Studio 2010 download to get up to speed with all the new enhancements then below is the link you can follow to go and get it.

Visual Studio 2010 is still in BETA release so you could see some minor changes in the full release but if you are keen to get ahead of the game it will help you get up to speed before it hits the shelves.

If you are looking for some video training to help you get the most out of Visual Studio then I highly recommend you drop by Learn Visual Studio.Net and take a look through their latest videos covering Visual Studio 2010 and .Net 4.0 (plus about 500 others to go at).

The LVS video training is top notch and if you have an iPhone like myself then you will be pleased to know they have also produced the videos in mp4 format that makes them perfect for small screens. Dead handy for making best use of that time on the bus or train!

Anyway... the download link - As of writing this post here is the latest Visual Studio 2010 Download. As I pointed out this is currently the BETA release.

Wednesday, 22 July 2009

Solar Eclipse 2009 Video - June 21st 2009

I went to see the total solar eclipse in Turkey back in 2006 and it was awesome with perfect weather conditions! I would tell anyone that given half a chance they should get to see one at least once in their lives! Id love to see another and as soon as one is within a decent travelling distance im all over it.

There was one that passed over Asia in the early hours but its taken me a while to find decent footage of it. Looks like they had a bit of cloud just at the wrong time but still you make out the corona etc..

So if you want to see a video of the event here is the site where i found it!

Enjoy!

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!

Sunday, 19 July 2009

Visual Studio 2010 Release Date and VS2010 Video Training

Visual Studio 2010 is currently at the Beta Test stage but already the excitement to the release date is growing. The actual official Visual Studio 2010 release date is still to be announced but it is currently expected to ship early in Q1 of 2010.

If you are looking to get ahead of the game and get to grips with some of the new features of Visual Studio 2010, then I highly recommend you head over to LearnVisualStudio.Net. As always, LVS have stayed with the latest cutting edge technologies and have already produced their first series of training materials for Visual Studio 2010 to get its members up to speed quickly.

In the first series there are 6 videos providing around 2 hours of video based training. The topics they cover are:


  • Visual Studio 2010 .Net 4.0 Language Enhancements

  • Visual Studio 2010 C#4.0 Specific Language Enhancements

  • Visual Studio 2010 ASP.Net 4.0 Web Forms Routing

  • Visual Studio 2010 ASP.Net AJAX 4.0 Binding

  • Visual Studio 2010 ASP.Net AJAX 4.0 Observer


There is plenty there to whet the appetite and more are being produced as we speak. If you are not a member of LVS and would like to know more please ask any questions in the comment box below.

Here is the link for the Microsoft Visual Studio 2010 Beta download.

As soon as the official Visual Studio 2010 Release Date is out I will put together a blog post about it.

So what are you looking forward to most in Visual Studio 2010?

Personally, I am very keen to check out the Microsoft Dublin component. If you have read any of my posts on Windows Workflow Foundation you will have seen the hassles I had in hosting the workflows. Well, Dublin is a component of Oslo (Microsofts new modelling framework), and it will be offered as a free tool shipped with VS2010 to enable you to host and monitor Workflows and WCF services.

If Dublin takes away a lot of the pain I went through with hosting Workflows in IIS then I will gladly look at using Workflow Foundation again. Since I first used it I have steered clear. Fingers crossed its all its cracked up to be.

Saturday, 18 July 2009

Microsoft Windows 7 Release - Amazon Are Taking Pre-Orders of Windows 7

Amazon have just put Windows 7 for sale on a pre-order basis! Its officially released on 22 October. I've put the links to the various versions and stores for your convenience:

For you guys in the US:

Microsoft Windows 7 Home Premium



Microsoft Windows 7 Professional



Microsoft Windows 7 Ultimate




For everyone here in the UK here are the Amazon UK Links:

Microsoft Windows 7 Home Premium E



Windows 7 Professional E



Windows 7 Ultimate E

Tuesday, 30 June 2009

LearnVisualStudion.net Sale - Learn .Net for peanuts with the 48 Hours Sale at LearnVisualSudio.net

If you have followed my blog at all over the last couple of years you will have noticed I am a champion of LearnVisualStudio.net

They offer a great training program and it is where I started out Learning .Net and it helped me massively getting started all the way though to holding my own in a .Net role.

If you are looking to learn .Net - either C# or VB.Net then I highly recommend these guys. Everything is done through the use of video (now setup to be iPhone friendly) and its so much better than reading a book. I have always been a visual learner so its great for me. As they say a picture paints a thousand words.

For the next 48 Hours they are running a sale giving you 30% off. A lifetime membership costs the equivalent of a couple of good books!

As always they follow the times and have recently released a new set of videos teachine Windows Presentation Foundation. Go fill yer boots! :o)

To check out their site visit the following link:

Learn Visual Studio .Net Sale

Any questions please post a comment. Don't hang around though if you are interested - the sale will be pulled at the end of the 30th June 2009.

Monday, 22 June 2009

Make Blogger Title More SEO Friendly

I was looking at some of the results from my blog in the search engines and noticed that owing to the length of my title the title pf the posts were simply not being displayed - hence probably not getting as many click throughs as it could.

I therefore had a search around and found the variables for setting descriptions etc from within blogger. If you look at my blog now you will notice that on the main URL it gives you the title but when you are viewing a post it gives you the title of the post!

This should make things stand out much better in the search engine results.

So here is the code you need to edit:

1. Go to the Edit HTML page from the layout tab in Blogger.
2. Look for the following in the header (should be very close to the top):



3. Now replace it with the following:



Job Done! It will now be interesting to see if I get an increase in traffic and possible ranking. If I do I will post about it.

Friday, 19 June 2009

New iPhone 3GS Internet Tethering

I am finally going to bite the bullet and move from the Nokia N95 to the new iPhone 3GS. I have fancied one for a while but not plumped for one as i didnt want another lengthy contact. However i am fed up with 3 mobile and their crappy network which is always dropping calls so time to move on. It wont cost me any extra per month so i shouldn't really feel a financial hit.

One of the things that stood out as very handy was the new tethering feature to use the iPhone as a modem. This looked a very attractive new feature. I knew the N95 could do it but this was just another feature to finally win me over.

This was until I saw the extra charges for using it! Bloody extortinate! £15 per month just to use the iPhone as a modem! This really pisses me off to be honest. Why doesnt the tethering usage come under your existing data and wifi usage!?????????

Even though, i will still probably get the iPhone but i wont be going for the tethering! I can get a USB dongle for £5 per month (it think) from Virgin media. My home internet connection for 10MB is only £20 per month! Just how they can justify £15 per month for effectively 3G connectivity is beyond me.

Can anyone tell me why they cant let you use your existing internet when tethered??? Or is it just another way to extract cash - pure and simple!??

Streaming MP4 to XBOX360

I you want stream MP4 video to your XBOX360 via Windows Media Player sharing I discovered when you browse to the folder with your MP4 files they dont appear as playable formats.

I found if you change the extension to AVI and then play part of the file in Wondows Media Player (this checks you have the right codecs etc) the video will appear and be streamed to your XBOX360.

You will probably have to back out of the menus on your XBOX360 (go back to the videos menu) and go back in to the folder first. The file list is then refreshed.

You can now stream MP4 files to your XBOX360! :o)