Tag Archives: C#

How to change type of chart of a Chart control in ASP.NET 4.0 programmatically

Introduction In this article I will explain how to change CharType of a Chart control in ASP.NET 4.0 dynamically at runtime Description Type of a Chart control can be changed by changing the ChartType property of the Series component inside the Series collection. ChartType property is set to SeriesChartType enum. Example: [sourcecode language=”csharp”] chartProducts.Series[“ProductSeries”].ChartType =… Read More »

Displaying alert message from code-behind in ASP.NET

In this post I will explain how to display alert message in ASP.NET from code-behind. We will create a function in the code-behind file to display alert message dynamically. We will register Javascript dynamically at runtime using ScriptManager.RegisterStratupScript method and display a Javascript alert message from the code-behind. Create a new ASP.NET Application and add… Read More »

Using server-side validation in ASP.NET CustomValidator control

In this post I will explain how to use CustomValidator server control for server-side validation. Using server-side validation, CustomValidator can take advantage of power of the server-side languages C#, VB etc. For example, we can validate an input control’s value using data from the database. In the following example we will see how to validate… 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 »

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 »

How to get directions using Bing Maps Directions module in ASP.NET

Download Source Code Introduction In this post we will see how to calculate route between two places on Bing map in ASP.NET Description We will use Bing Maps V7 SDK to load map and calculate directions between two locations. First we will store latitude and longitude of some cities in the SQL Server database. Then… Read More »

How to add Pushpins to a Bing Map from database using ASP.NET

Introduction In this article I will explain how to add Pushpins to a Bing map from locations (Latitude/Longitude) stored in a SQL Server database table Description We will use “Bing Maps AJAX Control 7.0 ISDK” to create Bing map. You have to create a key to use Bing map in your applications. You can refer… Read More »