Archive for March, 2010

OnSelectedItemIndexChanged invoked twice

Wednesday, March 31st, 2010

Wrong:

The list controls – radiolist, dropdownlist- that come part of asp.net 2.0 has an event called OnSelectedItemIndexChanged. In this event we can capture the event when an item in the list control changes its index. There seems to be bug in this event handling. This event is called twice even though a single item is clicked. This is because the page is sent to the server for both deselect of the previous item and select for the new item, and not simply select. The eventargs parameter does not have any indication that the item was selected rather than deselected. The sender parameter does not say the name of the control it is working with. To get around his problem, we can derive a new list control from the asp.net control and override the OnSelectedItemIndexChanged event.

Right:

The OnSelectedItemIndexChanged was called twice because it was invoked twice. The trap was the keyword AutoEventPostBack to set to true as well as wiring of the event through Handles event (in vb.net). This forced two calls rather one.

Web Application Vs Web Site in VS 2005

Wednesday, March 24th, 2010

Web Application or Web Site? The 2005 version of Visual Studio added some confusion to what to choose. The Visual Studio 2003 had a project concept. The dynamic compilation makes multiple assemblies without much developer control. The Visual Studio 2005 introduced a new web site concept. With the website, we don’t require IIS to run a web site. There was no project file necessary. It depended on the folder or file structure. This was a problem to sites which had sub projects in them – some developed in the version 2003. Microsoft came up with Web Application add-in to resolve this problem. With the Web Application, we can have a project file and sub projects in them. The whole project can be compiled into single one.

The Web Application is a right choice for a large scale web site. If the Visual Studio is integrated with Visual Source Safe, downloading a project from the VSS will create a virtual directory and this works well with IIS. Without a web application, we have to create a virtual directory through IIS. The default debugger would be the asp.net development server – a mini server with very less functionalities.

How cough has trapped me in utah

Saturday, March 13th, 2010

I have lived in Chicago and Texas before 2001. I did not have any problem with cough when I have lived in those places. I moved from Portland to Salt Lake City in 2001. That’s the time cough has caught me. The cough has become worse in 2002 and I had to see a doctor. The doctor prescribed albuterol and tussigon hydrocodone. They stop dry cough.

An year ago the cough has become worse and I had to go through continuous lungs testing and treatment. The lungs specialist initially said it is a mild copd, but later called mild asthma. I have to use sympycort to escape shortness of breath now.

Utah is a dry place. This is where anyone can be caught by dry cough. Drinking a lot of water and keeping the inside always moisture helps. The humidifier also helps.

Google is not smart

Saturday, March 13th, 2010

Google gmail is not smart. Gmail has a nice feature of grouping emails, and they call is conversations – the email correspondences between two people will be grouped together. I have found a glitch in their algorithm recently. Let us take as gmail message and the subject is “Las Vegas Vacation”. Send or forward an email message with the same subject from an unrelated email address, or you can assume it is coming from a friend. Now all these unrelated message with the subject “Las Vegas Vacation” will be grouped together. They should not because they are conversations between different authors.

SOAP Vs WCF

Sunday, March 7th, 2010

Which is more soa? The WCF is. The SOAP is exposed through an asmx page. This runs only on asp.net platform. There is overhead with this implementation. The WCF has a unified approach. The wcf does not have to run asp.net. Interface programming is hard with web services. The SOAP web services exposes web methods, so the developer has to start with an Interface and then implement a concrete class. The WCF always starts with a service.svc and generates interface. The WCF has more soa than SOAP web services, and is a better middleware. This has helped the application server (IIS, Apache) to fulfill it’s dream to implement a middleware. Applying security in the binding is easy in WCF while WS needs to implement the WS* extensions to do that. The WCF can be hosted anywhere unlike SOAP XML web service which requires a IIS. In WCF, we can have our own custom binding and use a separate data contract parser.