Sponsored Links

Hover effect on input type=image element

I was thinking about putting a hover effect on ASP .NET’s Imagebutton Control and well, first thing I did is that I found out what it gets rendered into. So I found out that it gets rendered into an input type=image Html tag. I used a technique of putting a hover effect with sprite images. [...]

A lost bet — Response.BinaryWrite Spoils the day!

Two days ago I lost a bet. My friend Jubair was generating a bar code image and he said how can I get it to display on the page without saving it as a file and giving its source to the image tag. I said you can’t do it because I thought it would be [...]

how to convert an integer to string and left pad it with zero's?

Here’s a quick and simple way of converting an integer to string (varchar) and left pad it with leading zeros like 00012. This example will get the result in 5 digits

select right(‘00000′ + cast(yourfield as varchar(5)), 5)

How to display an icon of your webpage in the address bar, tabs and in favorites

Method 1

This is the easiest method to implement and it will work regardless of the particular page on your site users choose to add to their favorites list. Don’t worry if you don’t have access to your web site root; take a look at the next method.

If you have access to the [...]

How to make a case sensitive comparision of strings in SQL Server

String in SQL Server are by default case insensitive. That means that “SQL” is equivalent to “sql” and it causes problems when you’re making a password authentication mechanism which is supposed to be case senstive. Here’s an example stored procedure in which I’m making a case sensitive string comparison for the password field using Collations.

CREATE [...]

jQuery effects not working after UpdatePanel Asynchronous request is over

A few days ago I was working on a project that involves a really good looking design and it had some fancy effects on a page with the help of jQuery library

The fancy effect was about showing a button over the picture with the title “View larger” when the mouse hovered over it and it [...]

Shared joy is a double joy; shared sorrow is half sorrow

Read this from someone who’s coming back from a beating. Just gotta say: it’s absolutely beautiful. I just love watching people who never quit and never say die. I hope and I pray that she’ll find her way out of her misery; as a matter of fact I’m quite sure she will God willingly

Shared joy [...]

A very rigid Regular expression for US Phone number format

Used this regular expression for a very rigid sort of a criteria for US Phone number format

\((?\d{3})\)\s*(?\d{3}(?:-|\s*)\d{4})

How to get and cancel the enter/return key in Javascript?

There was a problem I was facing with a web form I made, and that was that whenever the user pressed the enter key while typing in a text box, he was taken to the previous page. Obviously it was very irritating so I thought about making up a javascript routine to eat away the [...]

How to get the URL on which the application is hosted

string part_path = @”http://” + Request.Url.Authority + “/” + Request.ApplicationPath + @”/print/”;

This gave me the path such as http://localhost/myVirtualDirectory/Print/

when I deployed the application it also worked by giving the appropriate website name instead of localhost.