Author Archives: Jegan Smiles

ASP.NET: Disable, Enable Validator Using Javascript

Doing this is pretty easy, if you know how or what method to use. I wanted to disable a Validator for a province TextBox if the country DropDownList chosen is USA because the state DropDownList will be enabled so the province should be inactive. Doing this server-side may be easy, but I wanted to use…

Continue Reading »

Regex For Creating Usernames

A regular expression (called regex) is a way for a programmer to instruct how a program should look for a specified pattern in text and then what it should do when each pattern match is found. Rather than going through each character of a string and doing matches, regex makes life easier for programmers to…

Continue Reading »

ASP.NET: ValidationSummary For A CreateUserWizard Control

ASP.NET provides a control that uses the Membership API to create users on the fly via the CreateUserWizard control. The only drawback with this control is that you cannot include any other details like first name, last name, address and others. You would have to place all other details as a separate page, called a…

Continue Reading »

ASP.NET: Get Access Of Control Within A CreateUserWizard

Getting access to a control from within c# is straightforward. You just call the ID name and call the method or property that you want to use. If you are going to get access to a control from within a CreateUserWizard control and your code may look something like you call the Label control by…

Continue Reading »

ASP.NET: GridView Control

One of the reasons why I’m impressed with asp.net’s rich set of controls is its GridView control. This control displays your data in a table structure complete with delete, update and select features. It even has paging in case you have lots of records in your database. The best thing about this paging is that…

Continue Reading »

Email Using JavaMail

JavaMail, a technology from Java allows programmers to develop code that can send emails whether in plain text or HTML. Here’s a short easy code to send email to a recipient. public static boolean send(String replyTo, String from_email, String to_email, String subject, String body, String type) { boolean sent = false; try { Properties prop…

Continue Reading »

The Javascript Keyword var

I made this post to remind me that after so many years of using Javascript, I now know what the purpose of the keyword var really is for. The purpose for using the var keyword on a variable is to make it locally scoped. This means that if you use that inside a function, the…

Continue Reading »