Using Multiple .Config Files in ASP.NET

Submitted by planetsourcecode on
We can include multiple configuration files in our asp.net application, these things provide a feasibility to the use to work in more robust environment. The usage of multiple configuration file makes the application more secure and manageable Web.confi exposes an element that can be used as a place to store application settings like connection strings, file paths, etc.

How to generate a Random number using RNGCryptoServiceProvid

Submitted by planetsourcecode on
We can easily generate a unique Random number by using the inbuilt class "RNGCryptoServiceProvider".For doing this simply add class namespace to the header of the code-behind. using System.Security.Cryptography; write a simple function "GetUniqueKey" private string GetUniqueKey() { int maxSize = 8; int minSize = 5; char[] chars = new char[62]; string a;

ASP.NET Validation Tips and Tricks (Part1)

Submitted by planetsourcecode on
Tips1# Validate an IP address We can easily validate an IP address by Adding Namespace using System.Text.RegularExpressions; public class IPAddressTextBox: RegExTextBox { public IPAddressTextBox() { InitializeComponent(); this.ValidationExpression = @"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$";

Exception Handling

Submitted by admin on

What is an Exception?

Definition:

“When an unusual, irregular, abnormal or nonstandard condition arises in a sequence of code at run time this phenomenon is referred as Exception handling

An exception is a runtime error.

In Object Oriented, an exception is an object that is used to describes an exceptional condition that has occurred in a piece of code.

Open Cash Drawer(POS)

Submitted by emond on
Sample Script how to open a electronic Cash Drawer without any dll. Just connect through Epson TM series Receipt Printer. Great for developing Point of Sale. Hope ypu like it. For custom Softwares/ design Projects for Engineering Students Mobile +639155338048 Blog Site http://freeprogrammingtricks.blogspot.com//a> Facebook Fan Page http://www.facebook.com/emondsoft/ Skype

Skins and themes in ASP.NET

Submitted by planetsourcecode on
Sometimes we have to design those pages which have different color schemes but it is very difficult to maintain these types of pages. We can overcome from this situation by using skins and themes. This makes these things easier. 1). First create a Master Page having the following components. * One Content Placeholder 2).Create another page (default.aspx) and select the Master Page

Converting domain names to IP addresses

Submitted by planetsourcecode on
In ASP.NET, we can easily convert the Domain names to its related IP address like if a website like planetsourcecode.in has a domain name i.e planetsourcecode.com, It has also a corresponding Internet Protocol Address like 208.111.14.112. this can be easily done in ASP.NET using C# Steps for doing this: 1). First we have to include the namespace for this class Using System.net;

Interfaces

Submitted by admin on

Definition:

In java programming language, an interface is an abstract, conceptual or concrete type that is used to specify an interface.

How to use an interface:

  • By using the key word interface, we can fully abstract a class interface from its implementation.

It means that, using interface, we can specify what a class must do, but not how it does it.