Friday, May 7, 2010

How to install software on a netbook from a CD?

Not exactly a software development tip but a very useful one: If you have a netbook, you probably don't have a CD drive. How can you install a software with a CD installation? When I searched the web for a solution I found all kinds of suggestions like buying a portable CD with USB drive (the whole idea was buying a cheap computer, not having to start purchasing accessories), or use special applications for moving the content of the CD to a portable disk. Then my partner came up with an excellent and simple idea: after connection the netbook to the network, put the CD in one of the other computers on the same network, and share the CD drive. Then I could access the CD from the network and install all I needed.

Wednesday, April 28, 2010

Error: "The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)"

I got this error when I uploaded to the web server a new version of my site using LINQ. Everything worked on my local machine and on a local web server so I knew my code was right.
At first I thought the web server does not support LINQ and I asked the support group of the web server to enable LINQ for my site, buy they insisted that ASP.NET 3.5 that support LINQ is already installed and insisted that the problem is in my code.
Eventually I remembered that I didn't update the web.config file, since it is different for my local machine and for the web server, and I didn't want to overwrite the changes. When comparing the two files, I found out that this line is missing on the web.config file on the web server:
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=..."/>
After adding this line, I didn't see this message on the web server any more.

Monday, April 26, 2010

Why don't my dynamic controls work?!

I had a bug that drove me crazy: in one of my ASP.NET pages, none of the dynamic control worked, meaning when I clicked a button, nothing happened, and the callback function wasn't called.
I suspected AJAX, but even after I removed all traces of AJAX in the page, the controls still didn't work.
I started removing code from the page, until all the code-behind file was almost empty, to no avail.
So I went to the .aspx file, and started removing controls from the page.
Until I removed one control, and suddenly my dynamic controls started working fine.
The control that caused all the problem was a required field validation.
My error was that I forgot to assign a ValidationGroup property to the validator. Since it didn't have any validation group, it got activated every time any control was clicked on the page, and caused the action to fail using client call, before any code got to the server code-behind of the page.
I hope this will save some time for another programmer with similar problem.