Skip to content

Instantly share code, notes, and snippets.

@rahuldass
rahuldass / Scroll to the top of the page with Jquery.md
Last active August 29, 2015 14:04
Scroll to the top of the page with Jquery #jquery #scrolltop

###Scroll to the top of the page with Jquery

Demo Link :- http://jsfiddle.net/rahuldass/XUXNp/


HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
@rahuldass
rahuldass / Jquery Notification Bars that can be dismissed on click.md
Created July 20, 2014 09:43
Jquery Notification Bars that can be dismissed on click #jquery
@rahuldass
rahuldass / Shrink navigation bar when scrolling down.md
Created July 20, 2014 09:03
Shrink Navigation Bar when Scrolling down #jquery
@rahuldass
rahuldass / Remember Me functionality using CheckBox ASP.Net.md
Created July 16, 2014 17:48
Remember Me functionality using CheckBox ASP.Net #asp.net #remember-me

###Remember Me functionality using CheckBox ASP.Net

Remember the username and password for the user when he visits next time using Cookies in ASP.NET

ASP.NET Code

<form id="form1" runat="server">
    UserName: <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox><br />
 Password: 
@rahuldass
rahuldass / Check if record already exist in SQL-Server database.md
Created July 16, 2014 16:32
Check if record already exist in SQL-Server database #sqlserver #stored-procedure

Check if record already exist in sql-server database


Check if record already exist in SQL-Server database for this we have to write a stored procedure.

IF EXISTS(SELECT *  FROM TBL_Subscribers WHERE email = @address)
BEGIN
--emaild exist, so write code accordingly
END
ELSE
@rahuldass
rahuldass / Hide a text with read more link.md
Created July 16, 2014 16:25
Hide a text with read more link #asp.net #readmore
@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

@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 / 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 / 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"))%>' />