This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Inline approach */ | |
function showDiv(elem){ | |
// If your value is not "Select", then show the next option | |
document.getElementById('stepsHIDDEN').style.display = (elem.value != 'Select') ? "block" : "none"; | |
// If your value is "foo", then show another element | |
document.getElementById('showMeOn42').style.display = (elem.value == '42') ? "block" : "none"; | |
} | |
/* Switch statement approach */ | |
function showDiv(elem){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Keep track of how many users you have pulled | |
var usersPulled = 0; | |
// Every 5 seconds, pull a user | |
var userTimer = setTimeout(function(){ pullUser(); }, 5000); | |
function pullUser(){ | |
// Make an AJAX call to pull your specific user | |
$.get('/Users/Get', { skip: usersPulled++ }, function(user){ | |
if(user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary<Account,bool> comparisons = new Dictionary<Account,bool>(); | |
// Populate your dictionary | |
comparisons = Accounts.ToDictionary(k => k, x.modification_date > modification_date); | |
// Place a breakpoint here to compare true/false values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeController : Controller | |
{ | |
[HttpGet] | |
public ActionResult Index() | |
{ | |
return View(); | |
} | |
[HttpPost] | |
public ActionResult Index(string posted) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#customFields").on('click','.remCF',function(){ | |
// Push back the reference since one was removed | |
var previousIndex = possibleLetters.indexOf(currentLetter) - 1; | |
currentLetter = possibleLetters[previousIndex]; | |
$(this).parent().parent().remove(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mc_embed_signup{ | |
background:#fff; | |
clear:left; | |
font:14px Helvetica, Arial,sans-serif; | |
width:290px; | |
text-align: center!important; | |
} | |
#mc-embedded-subscribe { | |
background-color: #000!important; | |
border-radius: 0!important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckBoxChecking.aspx.cs" Inherits="Example.CheckBoxChecking" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ExampleProject.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
[HttpGet] | |
public ActionResult Index() | |
{ | |
return View(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class='Remove' data-id='42'>Click Me!</button> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script> | |
$(function(){ | |
$('.Remove').click(function () { | |
debugger; | |
var myId = $(this).data('id'); | |
$.ajax({ | |
url: '@Url.Action("Remove", "ReadingNow")?Book_id=' + myId, | |
success: function (response) { |