Category Archives: Asp.net

Recycle Current Application Context in Asp.net


Below is the code which is used to recycle or unload resources from current application context, it is very useful when you want to recycle current application context. HttpRuntime.UnloadAppDomain(); The above code terminates the current application. The application restarts the next time a request is received for it. UnloadAppDomain is useful for servers that have a large number of applications that infrequently receive requests. Rather than keep application resources alive for the lifetime of the process, UnloadAppDomain allows programmatic shutdown [...]

Tags: , ,

Crop Image Using JCrop in Asp.net C#


image_crop_aspnet_jcrop2

This tutorial will explain you how to crop an image using JCROP (library built in jquery) in ASP.NET C#(c sharp). We have used JCROP library to set size & coordinates of the area selected while cropping an image. Tweet

Tags: , , , , , ,

Validating Email in C# using Regex on Server Side


This articles explain you how to validate email in C# using regex. Below is method to validate email: Tweet

Tags: , , , ,

Send Email – C#, ASP.NET


This articles provides you a piece of code for sending email using C#. Sending email is necessary for any project whether its windows application, webservice or a web application. Tweet

Tags: , , ,

Complete solution for Url Rewriting in ASP.NET


This article describes a comprehensive solution for URL rewriting in ASP.NET 2.0. The solution uses regular expressions to rewriting rules to give and possible issues with postback from pages accessed through virtual URLs dissolves. Why use URL rewriting? Maintainability In large web applications, it is usual for developers to move pages from one folder to another. Let us assume that information on support was initially available on http://www.programmerclubhouse.com/Info/Copyright.aspx and http://www.programmerclubhouse.com/Support/Contacts.aspx, but later , the developer moved the Copyright.aspx Contacts.aspx pages [...]

Tags: , ,

Dynamically adding controls to a form in Asp.net


  At first sight it appears that adding a control to a form dynamically is quite simple. In fact, adding control to a form is easy. The problem is when you need to make a postback control disappear perform. This section discusses why a dynamically added controls disappear on postback and how to stop it disappearing. I also discuss how to get value from a dynamically created control. First we need to create a page that has a placeholder for [...]

Tags: ,

Setting the value of Password field in Asp.net


When the TextMode property of an ASP.NET TextBox is set to the value set in the Text property password is not displayed at runtime. This may be a pain, but it is actually the design of the exposed password avoid that is displayed in the HTML page source. As the safety is good not appear masked password value, the unmasked in the source, must also turn on the masked value in the textbox. For instance, a user profile page where [...]

Tags: ,

Simple Method to Resize Image in C#


Resizing image is a important part of software development. It enables us to reduce size dynamically while upload an image. Below is method to resize image in C# Asp.net. public void ResizeImage(string sSourceImageFileName, string sDestinationImageFileName, int iWidth, int iHeight) { Size oSize = new Size(iWidth, iHeight); Bitmap oBitmap = new Bitmap((Bitmap)Image.FromFile(sSourceImageFileName), oSize); oBitmap.Save(sDestinationImageFileName, System.Drawing.Imaging.ImageFormat.Png); oBitmap.Dispose(); } Add the above method in a class Imagecl.cs. Below is the usage of above method in ASP.net. Usage ImageUpload.aspx <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”ImageUpload.aspx.cs” [...]

Tags: , , ,