Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Asp 2.0

Hooking CustomValidator Control & Javascript

CustomValidator & Java-script Scripting

Validation controls are useful to perform the validation on the web forms. The asp.net framework provides validation controls like RequiredFieldValidator, RangeValidator and CompareValidator, etc. Sometimes, these validation controls are not fair to do the special validations. In those cases, we will go for the CustomValidator Control. In this example we will walk through the usage of the CustomValidator Control and learn how to link the java script function as the validation function.

Continue Reading →

FormView Control & SQLDataSource in ASP.Net

About The FormView Control Example

In this example, we will see how to make use of FormView Control of ‘Asp.Net to retrieve the data from the database. We will use SQLDataSource Control to supply the data for it. We will also look at modifying its Templates. This Control allows us to place the data-bound controls wherever we want. It is just like designing the form for calculating the Electricity Bill based on unit consumption. Now think of getting the table columns from the database and placing that freely on the web page wherever we want. This is achieved by the FormView Control.

Continue Reading →

Dynamically Changing ASP.Net Web Config File

The Dynamic ASP.Net Web Config Update Example

The Web.config file supplies the Website settings required for the ASP.Net web sites. These settings are like connection strings, how many users allowed, etc. Sometimes the situation arises where we need to add or remove the configuration settings without re-starting the server. This is to avoid website’s down-time. In this article, we will see a demo of how to change web config file when the site is running. Imagine that web admin of the site will access the page which we will create in this example. The goal is to add an extra web setting dynamically, and in the meantime, the server must function as usual with no re-start.

Continue Reading →

Web Config File and Tracing in ASP.Net

Broken Link On Home Page

Web configuration (Web Config) files are important for all the ASP.net hosted websites. Every application requires settings that tells the application how it should behave. Also, it will be handy to use as all the settings go in one place and if somebody wants to change some settings, they know this one stop place. What if we don’t use these Web Config files?

We should do it through the code. Now we will think of a situation of 100 settings for a website. If it is done in the code, anyone requires configuration change out of these 100, first need to search and pinpoint the piece of code that requires the changes. Then they should compile the binaries of the website and re-launch it. This requires a website maintenance window & during that time the website will be down. The ‘Web Config’ files avoid rebuilding the websites assemblies and keeps…

Continue Reading →