Skip to content

Instantly share code, notes, and snippets.

@rahuldass
rahuldass / Perfect Full Page Background Image.md
Last active May 7, 2023 16:43
Perfect Full Page Background Image #css

###Perfect Full Page Background Image

We can do this purely through CSS thanks to the background-size property now in CSS3. We'll use the html element (better than body as it's always at least the height of the browser window). We set a fixed and centered background on it, then adjust it's size using background-size set to the cover keyword.

CSS

html { 
  background: url(images/bg.jpg) no-repeat center center fixed; 
 -webkit-background-size: cover;
@rahuldass
rahuldass / Single Page Website with Smooth Scrolling.md
Last active August 29, 2015 13:56
Single Page Website with Smooth Scrolling #javascript
@rahuldass
rahuldass / HTML5 Starter Template.md
Last active August 29, 2015 13:56
HTML5 Starter Template #html5

###HTML5 Starter Template

Basic HTML5 starter template with HTML5 Shiv for older IE browsers.

HTML

<!doctype html>
<html lang="en">
@rahuldass
rahuldass / SQL Server Commands.md
Last active August 29, 2015 13:56
SQL Server Commands #sqlserver

###SQL Server Commands

Database used Northwind sample Database

-- USE for changing Database.
-----------------------------
USE Northwind
@rahuldass
rahuldass / Disable right-click on Images.md
Last active August 29, 2015 13:56
Disable right-click on Images #javascript

Disable right-click on Images


This script will disable right-click only on images.

$('img').bind('contextmenu', function(e) {
    return false;
});
@rahuldass
rahuldass / Google reCAPTCHA with ASP.NET.md
Last active August 29, 2015 14:01
Using Google reCAPTCHA with ASP.NET #asp.net #captcha

Google reCAPTCHA with ASP.NET


The reCAPTCHA ASP.NET Library provides a simple way to place a CAPTCHA on ASP.NET website, help us stop bots from abusing it.

Download the reCAPTCHA Library [here][1]

Steps

After signed up for your API keys, below are basic instructions for installing reCAPTCHA on site with ASP.NET:

@rahuldass
rahuldass / Make a CheckBox Checked inside GridView using Eval.md
Last active August 29, 2015 14:01
Make a CheckBox Checked inside GridView using Eval #asp.net #checkbox #gridview

Make a CheckBox Checked inside GridView using Eval


CheckBox checked inside GridView according to condition

<asp:CheckBox ID="CheckBox1" runat="server" Enabled="false" 
Checked='<%#Convert.ToBoolean(Eval("Active"))%>' />
@rahuldass
rahuldass / Current year in ASP.Net page footer.md
Created July 16, 2014 15:33
Current year in ASP.Net page footer #asp.net #footer
@rahuldass
rahuldass / Display Default Image when No Image Found.md
Last active August 29, 2015 14:04
Display Default Image when No Image Found #asp.net #html #image

Display Default Image when No Image Found


Display a default Image in the Image control, when the original image is not available. The same solution can be applied to both ASP.NET Image Controls as well as HTML image controls

For ASP.NET Image Control

<asp:Image ID="imgProd" runat="server"
onerror="this.onload = null; this.src='ImageurlORAnyImageHere.jpg';"/>

For HTML Image

@rahuldass
rahuldass / Preview an image before it is Uploaded.md
Created July 16, 2014 16:12
Preview an image before it is Uploaded #asp.net #javascript #image

Preview an image before it is Uploaded


Preview an image before it is uploaded in ASP.NET using Javascript

ASP.NET Code

<asp:FileUpload ID="File_Userimage" runat="server" onchange="showpreview(this);" />

Java Script Code