Archive for ASP.NET

Displaying Dynamically Generated Images in ASP.NET

June 8, 2009 | 3 Comments

Sometimes you need to display an image that is not saved in a file. These could be dynamically generated or loaded from a file but were modified. To display them in an Image control you need to create another page that saves the image in its output stream.

Read more…

Filed Under: ASP.NET

Check If User Name Exists Using AJAX And C#

April 26, 2009 | 11 Comments

ajax01

You could make sure the user name entered during the registration process of your website is unique before the submit button is clicked using AJAX and C#.

Read more…

Filed Under: ASP.NET, Mono 2.0

A Wrapper Class For hostip.info’s GeoLocation Service

March 18, 2009 | 2 Comments

hostip

GeoLocation refers to identifying a real-world geographic location of a computer, device or website visitor. There are a many websites that provide this service, some are free and some are not. A populare and free one is hostip.info. It provides country, country code, country flag, city, latitude and longitude of an IP address.

Read more…

Filed Under: ASP.NET, Mono 2.0, WinForms

What Are ASP.NET Master Pages

March 9, 2009 | 1 Comments

Master pages were introduced into the .NET Framework in version 2.0. They are web pages that can contain XHTML, server-side controls and user controls just like normal ASP.NET page (with .aspx extension), but with a .master extension. A master page serves as a template for ASP.NET pages that are based on it to help render a common appearance between them.

Read more…

Filed Under: ASP.NET

Displaying Gravatars Using C#

March 2, 2009 | 5 Comments

gravatar

Gravatar is a popular avatar service that links email addresses to the avatar. You do not need to register an account to be able to display gravatars on your site. All you need to do is construct the URL of the image using the user’s email.

Read more…

Filed Under: ASP.NET, WinForms

Get a Movie’s Details From IMDb

February 23, 2009 | 7 Comments

imdb

A while back when I was developing MoviePlay (a movies database) I wanted to allow the user to get the movie’s details from IMDb (The Internet Movie Database) instead of having him/her enter it manually. IMDb does not provide a way for developers to use their data, so I wrote the code below to screen scrape or web scrape the details from the movie’s page. It gets the title, director, genre, release year and tag line of the movie as well as the thumbnail.

Read more…

Filed Under: ASP.NET, Mono 2.0, WinForms

How to Get a Web Application’s Directory Path in ASP.NET

February 21, 2009 | 1 Comments

I found this question asked a lot in forums so I thought I should answer it here. Getting the physical path of the website can be done using Request.PhysicalApplicationPath. The following code also lists the sub directories of the website and how many files each one has.

Read more…

Filed Under: ASP.NET