Skip to content

Instantly share code, notes, and snippets.

View kmlprtsng's full-sized avatar

Kamalpreet Singh Chauhan kmlprtsng

View GitHub Profile
@kmlprtsng
kmlprtsng / AntiForgeryToken_Token_MVC
Created August 14, 2013 08:13
Adding AntiForgeryToken CSRF
using (Html.BeginForm())
{
@Html.AntiForgeryToken()
}
//In the Controller method add the annotation [validateAntiForgeryToken]
- Go into the command prompt.
- Run as admin.
- Go to the Framework folder. e.g. Windows\Micorosoft.Net\Framework\v2.0\
- run aspnet_regiis -site "SiteNameInIIS" -app "/" -pe "connectionStrings"
To decrypt replace -pe with -pd
@kmlprtsng
kmlprtsng / SMTP_Local_Folder_Web_Config
Last active December 21, 2015 01:38
Pointing SMTP to a local directory in web.config - ASP.NET
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="C:\TestMailMessages\" />
</smtp>
@kmlprtsng
kmlprtsng / Clearfix
Created August 14, 2013 08:25
ClearFix
/* http://stackoverflow.com/questions/211383/which-method-of-clearfix-is-best */
/*************************
Solution 1 - http://nicolasgallagher.com/micro-clearfix-hack/
*****************************/
/* For modern browsers */
.container:before,
.container:after {
content:"";
display:table;
@kmlprtsng
kmlprtsng / font_face_Using_Same_Name
Created August 14, 2013 08:26
font face - Using same font name with different weights
@font-face {
font-family: 'Liberation Sans';
src: url('fonts/LiberationSans-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Liberation Sans';
src: url('fonts/LiberationSans-Italic.ttf') format('truetype');
font-weight: normal;
@kmlprtsng
kmlprtsng / IE6_IE7_Inline_Block_Fix
Created August 14, 2013 08:27
IE6 IE7 inline-block fix
*display: inline;
zoom: 1; /*This also works for IE6*/
@kmlprtsng
kmlprtsng / IE6_Min_Height_Hack
Created August 14, 2013 08:28
IE6 Min height hack
selector {
min-height:500px;
height:auto !important;
height:500px;
}
@kmlprtsng
kmlprtsng / IE6_7_TextIndentFix
Created August 14, 2013 08:29
IE6 IE7 button not displaying fix - Text Indent not working
.btn {
cursor: pointer;
cursor: hand;
display: inline-block;
text-indent: -9999px;
background: no-repeat top left;
}
.lt-ie8 .btn
@kmlprtsng
kmlprtsng / Traget_IE_With_CSS_Class
Created August 14, 2013 08:32
HTML IE class target
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie ie6 lte9 lte8 lte7 "> <![endif]-->
<!--[if IE 7]> <html class="ie ie7 lte9 lte8 lte7 "> <![endif]-->
<!--[if IE 8]> <html class="ie ie8 lte9 lte8 "> <![endif]-->
<!--[if IE 9]> <html class="ie ie9 lte9 "> <![endif]-->
<!--[if gt IE 9]> <html class=""> <![endif]-->
<!--[if !IE]><!--> <html class=""> <!--<![endif]-->
@kmlprtsng
kmlprtsng / test
Created August 14, 2013 08:46
test
test