Blog

Captcha image in C#.NET

What Captcha stand for?Completely Automated Public Turing test to tell Computers and Humans Apart. The Captcha technology help you to make sure your site is reasonably secure against automated attacks.Write the following code in a class named Captcha:public class Captcha { //make the captcha image for text public Bitmap MakeCaptchaImage(string txt,...

Make previous calendar dates not selectable in ASP.NET

In order to make all dates before the current date, not able to be selected, in the onDayRender event for your Calendar:if (e.Day.Date < DateTime.Today) { e.Day.IsSelectable = false; }To make it more obvious to the end user, also add:e.Cell.BackColor = Drawing.Color.GhostWhite; e.Cell.ForeColor = Drawing.Color.Gainsboro;

Get the referring page on Page_Load event in ASP.NET

When a page loads, in order to get the name of the page that sent you there, all you need to use is:Request.UrlReferrer.ToString();You can create a global variable to hold it:string sReferrer = "";Then, in the Page_Load event, assign it:if (!Page.IsPostback) { sReferrer = Request.UrlReferrer.ToString(); }Or, you can put...