Friday, 04 June 2010
Handling the DropDownList SelectedIndexChanged event in a Repeater

This is more for my own reference more because I keep on forgetting how to do it and am constantly look it up all the time. If it helps you out, even better! And before you say "..but in MVC you can do it like this..". I know, but some of us still have to work with Webforms working with legacy apps. 

My main problem with DropDownLists in Repeater control examples on the net is they don't show you how to figure out which DropDownList in your Repeater list fired the SelectedIndexChanged event.

 
   1:   
   2:  // This is bound to the ItemDataBound event on the repeater.
   3:  protected void RepeaterBasketItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
   4:  {
   5:      DropDownList DropDownListQuantity = 
   6:          (DropDownList)e.Item.FindControl("DropDownListQuantity");
   7:   
   8:      // hint after typing += you can hit TAB TAB in Visual 
   9:      // Studio for it to create the event handler for you.
  10:      DropDownListQuantity.SelectedIndexChanged 
  11:          += new EventHandler(DropDownListQuantity_SelectedIndexChanged);
  12:  }
  13:   
  14:  // Handles the Selected Index changed event. 
  15:  void DropDownListQuantity_SelectedIndexChanged(object sender, EventArgs e)
  16:  {
  17:      
  18:      DropDownList dropdown = (DropDownList)sender;
  19:   
  20:      // Cast the parent to type RepeaterItem
  21:      RepeaterItem repeaterRow = (RepeaterItem)dropdown.Parent;
  22:   
  23:      // Inside the RepeaterItem find a hidden Literal I 
  24:      // placed there which contains the Item Id of the row. 
  25:      // You could use the DataItem if this is being persisted
  26:      Literal LiteralItemId = (Literal)repeaterRow.FindControl("LiteralItemId");
  27:      
  28:      // Parse this string into an integer
  29:      int itemId = int.Parse(LiteralItemId.Text);
  30:      
  31:      //You can do some error handling here if the parse doesn't work..
  32:      
  33:      
  34:      // Get the value from the dropdown list.
  35:      int newQuantity = int.Parse(dropdown.SelectedValue);
  36:      
  37:      // Over here you could put your update method. that uses itemid and new quantity.
  38:  }
posted on Friday, 04 June 2010 09:09:36 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Tuesday, 01 June 2010
Test blog entry from my iPhone
Testing blogging from my iPhone
posted on Tuesday, 01 June 2010 20:23:16 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Monday, 31 May 2010
Playing with Google’s Chromium OS

A while back Google announced they'd be working on their own Operating System (we all knew it was a matter of time before it happened eventually). At the time I was pretty excited by the prospect of trying out an Operating System released by one of the worlds most well known companies. However there wasn't much to see except for a few stick diagrams. Since then (almost a year), things have changed and we actually have something to look at and play with!

I got myself a VMWare disk image built from the source found at www.chromium.org and made available as an image by gdgt.

Firing up Chromium on my VMware workstation I was presented with the following screen

image

I was a bit baffled on what to type for a username and password until I looked it up on some of the online forum's. Its your Google username and password aka your Gmail account details! Thinking about it, it made a lot of sense. The Chromium OS is supposed to be a web based operating system and what would make more sense than to hook it into your Google account details, think about it a bit more and you suddenly see yourself being hooked into a platform. Its not just the operating system you are hooked into its the infrastructure that one company provides that the OS needs to live - sound familiar?

BTW if you have UK keyboard setting you will need to press SHIFT + 2 to get the @ symbol for your email address.

After logging in you see the following screen, and all of a sudden I fully get what Chromium is all about.

image

If you've used Google's Chrome browser you've pretty much experienced what Chromium OS is like.

Chromium is effectively an OS with one application, you guessed it! Google's Chrome Browser. The browser is the operating system and yes this also starts to make a lot of sense. Google I suspect will be investing a lot into this platform being a web based company, a browser is all they need to get to their customers. If you make it cheaper by releasing a free operating system (open source) you pretty much cut out any dependence on the likes of Apple or Microsoft for your browser to run. You control the software technology stack between you and the user.

Playing with other apps I use quite frequently on Google such as Google Docs reminded me that the OS is pretty much still new and it would tend to hang on some applications every now and again. In the image below it hung on initialising Google Docs. Although I wasn't sure if this was my VMware host acting up or the OS itself.

image

Bouncing the virtual machine and logging in again I get the familiar screen below.

image

I attempt to access Google Docs again and everything works as it should! I then decided to fire up YouTube and yes it all seems to work. Although I was unable to work out if the video was playing with Flash or using a native HTML 5 player.

image

Verdict so far is that its a great idea and you can see its take up being pretty big, especially in third world countries where they can't afford expensive OS's such as Microsoft Windows and Mac OS X. Its a simple operating system that's easy to use and its very cleverly following the cloud paradigm where any computer you log into can be your workstation and all of "your stuff" is stored in the cloud. You're free from hardware, your laptop or PC just becomes a way for you to get to your web based OS.  I'm not too sure how the OS will work without the Internet though and its not too clear how I can work offline or store my files for use later. Will there be support for me to plug in my USB stick to transfer files or pictures I'd like to email? Will the OS use cached user credentials to log me in if I don't have Internet access at the time?

posted on Monday, 31 May 2010 11:55:25 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Thursday, 18 March 2010
I got iPhoned

Okay I finally gave into the iPhone revolution. I must admit I'm not one to follow the trend and like to stick to more unusual phones that not too many people have. It took me a while but I finally get what the iPhone is all about. Firstly it doesn't really do anything any other phone on the market doesn't already do, however what it does do it does it simply and very well.

Apple's iPhone isn't just about functionality its about ergonomics. It not that you are able to browse web pages, its how you are able to browse web pages on the phone that sets it apart. It also makes you realise what Microsoft might have achieved with its Windows Mobile if it had followed the same route Apple did. Apple gives you an experience and that experience starts from the box your iPhone comes in all the way to the experience you first have with the phone. 

posted on Thursday, 18 March 2010 22:07:36 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Saturday, 20 February 2010
Are we building surrogates?

Having recently watched the film Surrogates staring Bruce Willis, based in a futuristic world where everyone stays at home and plugs themselves into a device that enables them to control a robotic clone (albeit better looking and flawless) representation of themselves. It really got me thinking on how people do more or less the same thing with social games such as Second Life and how far away we could possibly be from this happening in reality. Having one for everyday use in everything you do would be a bit creepy but having one as a representation of yourself in meetings in distant offices would be pretty cool. Especially if you were an engineer who was needed, say at a plant to fix something you could do it quickly using a surrogate.  So reading Scott's blog posting on Building an Embodied Social Proxy or Crazy Webcam Remote Cart Thing got me thinking, it probably won't be too long until we are using something similar in our offices. It will probably start with video conferencing and then move onto devices that can be controlled by a computer sitting on a robotic cart (laptop). Imagine Microsoft releasing software for this type of application and you had USB devices that were built to compliment it. Maybe they would be MS Social Proxy Certified devices? An MS Social Proxy Cart that carried a laptop that was plugged into it and could control its motors, robotic arms the list goes on... It could start off simple and then progress from there?

Googling a bit more I discovered doctors in some hospitals were already making use of such technology. Controlling six foot tall robots remotely with large plasma screens on the front to display their faces as they visited patients on wards in hospital. It seems as though this could possibly be the start of a new industry? Lets just hope it doesn't stop us from interacting with real people personally as it did in the film Surrogates.

posted on Saturday, 20 February 2010 12:11:11 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Friday, 12 February 2010
Google Buzz, Yahoo Buzz, Windows Buzz….

Google Buzz yet another release by the search engine giant in an attempt to get a piece of the large social network and micro blogging platform pie Facebook and Twitter have carved up among themselves. What surprises me about Google Buzz is that Microsoft and Yahoo have implemented such functionality in their own offerings Hotmail and Yahoo Mail some time ago. Although as always Microsoft's marketing department seems far better with its software and OS offerings than anything to do with its email and social networking platforms. Yahoo on the other hand appears more interested in getting people to change their home page to Yahoo (we have all seen the TV ads) but they haven't really given us a reason why (or I have missed the reason). I have tried out Yahoo's offerings and can't quite understand why its better. They have added some nifty little gadgets such as the search pad and they have integrated their own form of "Buzz" (and they will probably cringe when I use that word), in the way of allowing people to see your updated status and enabling you to hook in YouTube, Twitter, Picasa, StumbleUpon (to mention a few) into your status updates.

I suppose Microsoft and Yahoo's approach to the whole subject has been well if we can't beat them we may as well come up with a way to compliment or to work with the flow. In this way Microsoft and Yahoo knew people wanted to keep using these networks and nothing they could offer would sway them from using them, so decided to make all these things easily accessible from their own platforms. "Hey guys you can access all your social networking from one site!"

I think Google have thought of much the same theme however Google has been a lot more vocal about it or maybe its just that we pay a lot more attention when Google says something than if Microsoft or Yahoo says something these days? Google unlike the others has given it a name, Microsoft now a days when they give something a name seem to confuse customers even more. First it was MSN, then Live, then live search became Bing and then there was something called Windows Live services and what happened to hotmail oh is that Windows Live Mail now? Google are very good at keeping what they offer clear and to the point. Googles' web pages are clean and you're not too confused on where to go. Yahoo and Microsoft's Live/hotmail/MSN (what ever they call it now). Is very much hidden away or not that easy to find on their busy and very advertising focused websites. I remember thinking a while back I would like to try out Microsoft's new search they kept on talking about it but I couldn't figure out what site to go to to find it. I eventually found it under www.live.com, however Microsoft rebranded it yet again and now are asking people who visit their home page to change it to www.bing.com. Maybe Microsoft would be more successful with their offerings which are pretty good if they were more consistent and didn't keep on changing their minds on what they were going to call themselves. Few people realise that they can access Microsoft's online version of Office (albeit in Beta) from their accounts as you can with Google Docs.

posted on Friday, 12 February 2010 14:48:17 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Saturday, 16 January 2010
Are applications trying to do too much?

I read this article on ZDNet about Google pulling out of China because of security threats. What interested me was the evidence discovering that Google wasn't the only company being hacked in this way. There were several other top companies that were being hacked by sophisticated means originating in China.

One paragraph that interested me was how some corporates had been hacked using a vulnerability in Adobe Reader. People in these companies were sent emails that included PDF files that exploited this vulnerability. I suppose what annoys me the most is how easy programs can be exploited to hack or infect systems. Viewing PDF documents used to be a rather simple affair I double click on my PDF and it opens for me. Now a days Acrobat Reader takes so much longer to open and almost every time it has a brand new update to apply something that makes me as a user, furious. All I want to do is look at the contents of a document I do not want any clever bells and whistles and I most certainly am not interested in having Javascript running in my PDF document.

I think somewhere along the way Adobe changed what the PDF was for. It was never intended as an interactive way of displaying documents or filling in forms. It was supposed to be a way to transfer, view and print documents as they were intended. This seems to have changed through the life of the format something I think could lead to the odd security vulnerability every now and again.

In the old days it was pretty simple avoiding viruses. If someone sent you a program by email or you were asked to download and execute a program you were most probably likely to pick up a computer virus somewhere along the lines. Avoiding these kind of attacks were pretty simple, but as technology progressed avoiding viruses has become a bit of a nightmare. One attack that really had me worried the first time I had heard about it was a vulnerability in the JPEG format that could cause a buffer overflow error on Microsoft OS's at the time. This meant basically viewing an image on a webpage could give you a a virus! A JPEG is not an executable file just as a PDF is not an executable file in all rights I the user should feel perfectly safe viewing these files on my machine and not have to worry about viruses.

The problem has also become two fold. Anti Virus software vendors appear to be releasing never ending updates and their programs appear to be coming more and more bloated as a response to virus and hacking exploitations. Looking at the disk activity on your machine you will probably notice that most of it is the work of your virus scanner. If you are unlucky to have your virus scanner setup incorrectly or have a program such as Windows Defender and a Virus Scanner installed at the same time these program will inevitably scan what each other are doing which can lead your machine to grind to a halt as I have found.  I think the Operating System needs to make a change to accommodate the fact that a Virus Scanner will be running and that somehow this needs to address the issues with performance on machines and work in harmony with the OS. Long standing applications such as Adobe Reader need to stop introducing progress by bloating their software just as the very web browsers we use now a days have started to become more and more bloated (again). Applications should come with the minimum required and if you choose to use the other features, it should ask you if you want to use them when the need arises or when you install them. If your application is trying to do too much maybe you need a separate application?

posted on Saturday, 16 January 2010 12:49:11 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Friday, 25 December 2009
My favourite film baddies

Here is a list of actors I absolutely love as the baddies in films. Usually when I see these actors as the cast of a film (as the baddie) its enough to make me watch the film.

TerenceStamp Terence Stamp
He doesn't always play the baddie in films, but when he does he's one of those baddies you love to hate.
JeremyIrons Jeremy Irons
Excellent in Die Hard. He plays the highly intelligent baddy.
TimCurry Tim Curry
A funny and evil villain. My best film with him in is The Three Musketeers as Cardinal Richelieu.
BenKingsley Ben Kingsley
One of the most unusual baddies.
EdHarris Ed Harris
Usually in military style movies as the bad guy or the crooked cop.
LuisGuzman Luis Guzman
He is usually one of the best baddie henchmen.
SamuelLJackson Samuel L Jackson
One of my favourite all time baddies and good guy in films.
RobertPatrick Robert Patrick
The T-1000 in Terminator 2. Need I say more?
HugoWeaving Hug Weaving
Agent Smith from the Matrix.
posted on Friday, 25 December 2009 00:02:01 (GMT Standard Time, UTC+00:00)  #    Comments [0]