Author Archives: deepaksharma009_i2143s95

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 »

How to create charts in ASP.NET 4.0 using built-in Chart control

Introduction In this article I will explain how to create charts in ASP.NET 4.0 using the Chart control introduced in ASP.NET 4.0 Description ASP.NET 4.0 introduced a new data control “Chart” with Visual Studio 2010. Chart control can be used to create around 35 types of interactive charts. Data in the chart control can be… Read More »

Data binding in ASP.NET Repeater control from code-behind using DataView

Introduction In this article I will explain how to bind data to a Repeater control in ASP.NET from code-behind using DataView to render a DIV layout Description In this article we will create a DIV layout using Repeater control to display product list with their images. We will use DataView to sort and bind data… Read More »

Data binding in ASP.NET Repeater control using SQLDataSource control

Introduction In this article I will explain how to bind data to a repeater control in ASP.NET Description Repeater control displays repeated set of data from the data source. It can display data in any form as per our need, in a table layout, a div layout, a comma-separated list, an xml format, ordered list,… 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 »

ValidationSummary control in ASP.NET

ValidationSummary sever control in ASP.NET displays all the validation errors on the page at one place. ValidationSummary displays ErrorMessages of all the validation controls which fail to validate as summary Properties of ValidationSummary control Property Uses DisplayMode Gets or sets display mode of the ValidationSummary control. It can be set to BulletList, List or SingleParagraph.… 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 »

Using client-side validation in ASP.NET CustomValidator control

CustomValidator server control in ASP.NET is used to validate an input control using a custom function. It provides programmer with the flexibility to use a custom function for validating an input control. CustomValidator can validate a control using a server-side function or a client-side function. Server-side function is written in server side language like Visual… Read More »

RegularExpressionValidator in ASP.NET

RegularExpressionValidator validation control in ASP.NET validates a control according to the regular expression (RegEx) set to its ValidationExpression property. Using this validation control we can specify a format of data that a control should accept using a RegEx. For example, we can validate a Phone number, Email, Zip Code etc using a RegularExpressionValidator control. Properties… Read More »

Validating list controls in ASP.NET using RequiredFieldValidator

RequiredFieldValidator control can be used to validate ASP.NET list controls like DropDownList, ListBox and RadioButtonList so that they cannot be left blank. Users must select a value from these list controls when validation has been applied. To validate a list control, we need to set InitialValue property of the RequiredFieldValidator along with other properties. Let… Read More »