Thursday, November 30, 2006

ASP.NET 2.0 Validation Controls

ASP.NET 2.0 has not introduced any new validation controls but MS has enhanced the existing validation controls a lot

Validation Groups

Now you can have multiple form areas on the same page by grouping the controls to be validated by using ValidationGroup property of controls.

This feature supports server side validations too. In Addition Page.Validate() method has been enhanced and GetValidators() method has been added. Specifically Page.Validate(ValidationGroupPropertyValue) and GetValidators(ValidationGroup) makes your life much easier

Focusing Controls

Validation Controls now have SetFocusOnError property to make the control focused in the case of an error. You can also use the Focus() method of server controls which will add client-side JavaScript to set focus to a particular control on page load

Browser compatibility

MS has used document.getElementById(id) in validation controls making client side validation possible in all the browser which supports JavaScript 1.2 or higher. This has make all the controls to be work in IE, Firefox and Opera.

Following are the Base Validation Control Properties from MSDN


The programmatic ID of the input control that the validation control will evaluate. If this is not a legitimate ID, an exception is thrown.


The display behavior for the specified validation control. This property can be one of the following values:

None — The validation control is never displayed inline. Use this option when you want to show the error message only in a ValidationSummary control.

Static — The validation control displays an error message if validation fails. Space is allocated on the Web page for the error message even if the input control passes validation. The layout of the page does not change when the validation control displays its error message. Because the page layout is static, multiple validation controls for the same input control must occupy different physical locations on the page.

Dynamic — The validation control displays an error message if validation fails. Space for the error message is allocated dynamically on the page when validation fails. This allows multiple validation controls to share the same physical location on the page.


Because space for the validation control is created dynamically, the physical layout of the page changes. To prevent the page layout from changing when a validation control becomes visible, the HTML element containing the validation control must be sized large enough to accommodate the maximum size of the validation control.


Indicates whether client-side validation is enabled. You can disable client-side validation on browsers that support this capability by setting the EnableClientScript property to false.


Indicates whether the validation control is enabled. You can prevent the validation control from validating an input control by setting this property to false.


The error message to display in the ValidationSummary control if validation fails. If the Text property of the validation control is not set, this text is also displayed in the validation control when validation fails. The ErrorMessage property is commonly used to provide different messages for the validation control and the ValidationSummary control.


This property does not convert special characters to HTML entities. For example, the less than character (<) is not converted to &lt;. This allows you to imbed HTML elements, such as an <img> element, in this property's value.


Specifies the color in which to display the inline message when validation fails.


Indicates whether the input control specified by the ControlToValidate property is determined to be valid.


Indicates whether focus is set to the control specified by the ControlToValidate property when validation fails.


When set, this message is displayed in the validation control when validation fails. If this property is not set, the text specified in the ErrorMessage property is displayed in the control.


Specifies the name of the validation group to which this validation control belongs.


Wednesday, November 29, 2006

ASP.NET 2.0 Problems / Issues with Master Pages

I faced hell of a lot of problems when doing Master Pages. Master Pages will work smoothly as Microsoft says if your application is a very simple and all the files are in the same directory. But if your application is bit complex, where you have to use multiple directories for different user roles etc, then you will have face lot of problems implementing Master Pages.

I was able to solve almost all of the problems by referring to  following posts. So read them and solve your problems too...

Wednesday, November 22, 2006

Looks Like Macs Crash Too

This is interesting set of video clips from MAC conference.  Seems all are in the same boat :-) ....

Wednesday, November 08, 2006

ActiveX plug-in from TODO: <File Description> from TODO: <Company name>

Do you install an ActiveX plug-in from Unknown publisher? Or if IE says that it’s from TODO: <company name>? Click on the following screenshot to see what I'm taking about.

IE add-on TODO: <File Description> from TODO: <Company name>

Click on the image to see the message clearly.

This is from non-other than Yahoo. Its good programming practice to put TODO: in your code where you can attend later rather than just keeping them on your mind. But releasing the software without removing them and without checking.....disaster…..

Sunday, November 05, 2006

Microsoft and Novel Agreement

Microsoft and Novell have signed a cooperative technology deal on Nov 2nd, which will make it easier for Novell's Suse Linux distribution and Microsoft Windows to work together.
According to news the Mono (open source version of .NET) is free from possible Microsoft patents.
Check out more on this @


Google News

Sunday, August 27, 2006

One Vista Demo...:-)

This video is bit old. But how come something like this could happened?. When you say "Dear Mom" how can it picks up as "Dear Aunt". MS getting screwed big time here :-)


Tuesday, August 22, 2006

Great... Photograph

Ruch, originally uploaded by Marooned.

Monday, August 21, 2006

Failed to generate a user interface of SQL SERVER due to a failure in starting the process for the user interface

I got the above error when I want to check some Win Form samples with the SQL Server Express.

I found the following resources on the web, but non of them was able to resolve my problem. But one comment made by Manoj was to able to make it work even its not the solution.

I was satisfied with it since I wanted do some thing else with Windows forms. But need to find a solution in future.

So any of you have found a real solution to above please forward me....

Friday, August 18, 2006


Cool soothing song, even, I cannot undestand the words. Thanx, Asela to finding the name of this from VS launch

Friday, June 02, 2006

.NET Developers

My Office wanted to find some good .NET resources since two of our best guys are leaving. So we found some CVs through the staff itself and we interviewed some of them. After spending time for all the interviews, we could select only one person, but unfortunately he had commitment to his current work place as he was leading the team there. So he was not in a passion to join
The GM proposed that we should go for a big paper advertisement and we should conduct an examination to recruit some people. But when I looked around,  I found lot of paper advertisement similar to our requirement in the Sunday paper. It that case, it’s a game of convincing developers, why they should select our company.  

I think you can find Three types of resources in the industry.
1) People who have a degree as a qualification and know some development language semantics form some course or certification.
2) People who are creative, who reads books, who experiments and challenge software development concepts.
3) People who have no idea what programming is

1st type of people is usually recruited by large outsourcing companies. Because they have a well setup internal process and its matter of training new people to follow the process and making them knowledgeable only in the area that the company wants them to be fit in.

2nd types are the people who works is small or medium scale development companies. Companies which develop products or custom creative projects based on customer requirements. The customers of these companies are not ready to pay for various additional resources such as business process consultants, dedicated project managers etc. They expect a team of 5-10 people will do the job for a flat rate and they don’t wont jazz like dedicated project manager and domain consultant etc..

These requirements result the need of multi talented, very creative people to support these software projects. The developers should have little marking ability and personality, planning ability, R&D skills and self discipline to very closely communicate with team members and management. The reason is that, there are no closely monitored process and supervisor level people to monitor whether everybody is following the process. Basically no one will consider the management time as a need and no one is there to pay for this time.

When you compare software developers, you can find hundreds or thousands of people of category 1, but very limited people like 500 for category 2. Because category 2 is value addition to category 1 and the companies looking for category 1 prefers category 2 people.

Therefore finding a category 2 person is very hard. Even if you find one, he is currently working in someplace and they won’t allow him to leave. They will offer what ever he wants because it’s a very valuable asset to them and they know how hard it is  to find same caliber of a person.

I think usually at a given time, there are 20-30 developers in category 2 changing their companies due to some reasons. But since there are new companies joining the industry every day, grabbing one is been a major challenge.

In a way the outsourcing model has created some of the problems.
Consider the garment industry in Sri Lanka. Sri Lanka is one of the best countries who produce garments to the world. But see how it works. International company seeks a local partner to outsource its production. They will setup the factory, train people, and create processors and they will create a best business venture.

But what happened when the US stop the quota system.?. Most of the Sri Lankan garments factories had to close. My point is that, knowledge won’t come to 3rd world countries as to independently operate. Some consultant creates a process and makes our people to follow that. Locals don’t know the whole operation. That’s why they couldn’t create own brands and designs and market it to the world. Locals are best at following someone else’s process productively but not at creating complete processors own there own.
This is happening to the local Software industry as well. A company which does well in outsourcing in SL has only their production arm locally. Either there process is setup by some international consultants or they are getting the whole spec from another country to produce the code.

Some time back I interviewed a Software Engineer, who worked in some major outsourcing company in Sri Lanka. When I asked him some simple questions like , “how to make a connection to the DB” for my surprise, he told me that he doesn’t know to do it as they are using ready made components.

This is the bad side of outsourcing. It will make our workforce dumb; destroy their creativity and destroy the eager to learn new things. Most of the developers don’t like to put extra effort to lean something and improve themselves from developers to architects or some senior level. They want a higher salary with less effort but doing same set of job functionalities. This has not become a problem now because there are lots of outsourcing jobs in the country. But we have no idea when this model is going to fail. In that day we are going to face a hell of a problem….

Sunday, May 28, 2006


This is really cool. You need Macromedia Shockwave player to view this. Believe me its worth downloading. Click Click Click......

Wednesday, May 24, 2006

Intellisense for SQL Server

Found another good tool while browsing the web. SQL Prompt™ will add Intellisense to your SQL queries. Currently its free and hope it will be the same in the future.


BusyBoxDotNet is free ASP.NET Control which can be used to a show a Message when performing long process.

Seems to be a very useful control, Check it out @

Sunday, April 23, 2006

Introduction to Windows Workstation Foundation (WF)

[SDK, Up Coming Tools]

Consider a process like “Complain Management System”, where you need to get the customer complains through a Web site or a published for Phone no. Internal employer should be appointed to act upon complains and take the necessary actions. A Manager should review the employer actions and then get back to the customer.

Typical organization wants to implement many processors like this and monitor the progress of them.

Some elements are human processes and some are System process if you take a look at the above ( e.g Customer needs to enter the complain through a website is Human responsibility and authenticate customer in to the system is System responsibility.)

You can find hundreds of processes like this in your day to day work environment. Do you have a facility to setup something like this using MS Office or other available software?This is where the up coming Windows Work Flow (WF) comes in to place. WF will be an Application development framework to design applications to setup work flow in your organization and a user friendly integrated set of tools with next
Office Suite (V12).

More @

Mapping Data Provider Data Types

[.NET 2.0 Data Access]

We recommend that you use the typed accessor methods of the DataReader when you know the specific type of the value being returned. Typed accessor methods result in better performance by returning a value as a specific .NET Framework type, eliminating the need for additional type conversion. The SqlDataReader exposes SQL Server–specific typed accessor methods if a .NET Framework type does not meet the needs of the application. SQL Server–specific typed accessor methods return objects of System.Data.SqlTypes.” -- local MSDN

Above lines are extracted from MSDN which confirms that you should use accessors to read the data out of data readers and it will result better performance since it eliminates type casting. Further MSDN describes the getter names which you should use in SQL and Oracle provides for specific data type. So better to read section “Mapping Data Provider Data Types to .NET Framework Data Types” before reading values from datareaders.