Printing in ASP.NET

Submitted by planetsourcecode on
In windows desktop application it is easy to print a form data for report or other purpose but in asp.net web form it is not easy to print a page. The printing on client side needs solutions for different conditions using JavaScript The simplest way to print a web form is to use client side JavaScript. To print a web page, you can use code like this:

Disable Right Click and Ctrl Keys in ASP.Net

Submitted by planetsourcecode on
We can easily disable right click and control keys in asp.net.In come circumstances.We want to disable the right click so that the user can not copy from or to the asp.net web page.In most of the web application it can be use in any possible condition. for doing this we have two possible ways: 1). Using asp.net method, which is used when we don't want to show message to the user

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;