Category Archives: .Net

How to avoid space occupied by an inactive validation control in ASP.NET

A validation control occupies space even if it is not showing any error. This is because by default Display property of the validation control is set to Static. For example, if we take two validation controls, one RequiredFieldValidator and one RangeValidator and if any of the validation fails, both the validation controls will consume their… Read More »

RangeValidator control in ASP.NET

RangeValidator validation control in ASP.NET is used to validate whether the value of a control is in a given range. It can validate Currency, Date, Double, Integer and String value. Properties of RangeValidator control Property Uses ControlToValidate It takes ID of the control you want to validate Type It specifies the type of data you… Read More »

CompareValidator control in ASP.NET

CompareValidator validation control in ASP.NET is used to validate an input control’s value by comparing it with another control’s value or a constant value. For example, we can use CompareValidator to validate controls if we want user to enter same value in two different controls, to compare value of a control with another control, to… Read More »

Validation controls in ASP.NET

Data validation is very important while accepting input from user. There may be different business logic for validating data. Some basic validation would be to validate a field to accept only numbers or a valid email address or phone number of a country in a specific pattern etc. ASP.NET provides some built-in controls for this… Read More »

Adding markers to Google Maps from database using ASP.NET

Introduction Here, I will explain how to add markers to Google Maps from SQL Server database using ASP.NET Description Here first we will create a table “Locations” in the SQL Server database to store latitude and longitude of the places to which we want to add markers Step 1: Create table as following [code language=”sql”]… Read More »

Using single event handler for multiple control’s event in Windows Forms and ASP.NET using C#, VB.NET

Introduction: In this post I will explain how to use single event handler for click event of multiple Button controls in Windows Forms and ASP.NET using C# and VB.NET Description: Event handling in Windows Forms Create a new Windows Forms application and four buttons on the form, “btnAdd”, “btnSubtract”, “btnMultiply” and “btnDivide”. Write following event… Read More »

Changing UICulture of master and content pages on button click in ASP.NET using C#, VB.NET

Download Source Code Introduction In this article I will explain how to change UICulture of master and content pages on button click in ASP.NET. This will enable users to select a language to view contents of a page/site. When user selects a language, UICulture of the page is set to that specific language and page… Read More »

Adding dependencies to a setup project

In this article I will explain how add dependencies or prerequisites to a setup project Introduction A project we create may be dependent on some other software to work properly. We can add dependencies or prerequisites to these software components in our setup project to ensure availability of the required pre installation software. For example… Read More »

How to store user’s preferences in a Windows Forms application

Download Source Code In this post let’s see how to store user’s preferences in a Windows Forms application Introduction In this post we will see how to store user’s preferences in a Windows Forms application that persists even after closing the application. Here, we will give users an option to select font and background color… Read More »

How to play flash in Windows Forms application using C#

Download Source Code Introduction In this article we will see how to play a flash (.swf) file in Windows Forms application Description We have generally two methods for playing a flash animation in a Windows Forms application: Using COM component, Shockwave Flash Object Playing flash inside a WebBrowser control Method 1: Step 1: Create a… Read More »