Cross Page posting in asp.net

Submitted by planetsourcecode on
Cross Page posting in asp.net We can cross post the data in asp.net from one page to another page.Cross Page posting feature allows a page to cross post to another page which in turn allows you to access all data in posted source page. By simply setting PostbackUrl property, we specify the destination page to which present page should post when post back occurs on present page.

Upload binary data the Database

Submitted by planetsourcecode on
Some times we have the requirement to upload an image to the database in binary form. As uploading a image file to the database has many different benefits as compare to uploading files to the Web Server Folders So let’s starts from the database table design The fields includes in table are: 1) ID – Primary Key 2) Filename – Store name of the file. 3) Mime- what type of file is it.

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.