Skip to content

Instantly share code, notes, and snippets.

//use off to remove any other hanlder on this radio.
$('input:radio[name$="rblSourceAllocationType"]').off().on('click', function() {
//identify with something other then text!!! or use the filters as it is coz you are already using it on line 1560/1561
if ($(this).val() == "Default") {
alert("Default radio");
//perform some action
}
else if ($(this).val() == "Override") {
alert("Override radio");
@siddharth-pandey
siddharth-pandey / gist:9111125
Created February 20, 2014 10:53
prevent click handler's by ko prevent Bubble
<div class="outer" data-bind="click: toggleColor, css: bgColor">
<p class="center">
<input type="text" data-bind="preventBubble: 'click'">
</p>
</div>
<script>
ko.bindingHandlers.preventBubble = {
init: function(element, valueAccessor) {
var eventName = ko.utils.unwrapObservable(valueAccessor());
@siddharth-pandey
siddharth-pandey / gist:9207894
Last active August 29, 2015 13:56
route code sammy.js
//html
<form id="loginform" action="#/login" method="post" class="form-horizontal">
<h4>Use a local account to log in.</h4>
<hr />
@Html.ValidationSummary(true)
<div class="form-group">
@Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
//css
<style>
.loaderwrapper {
border: 1px solid grey;
width: 100%;
height: 100%;
position: relative;
}
@siddharth-pandey
siddharth-pandey / gist:9386512
Created March 6, 2014 10:01
code to create iframe.
var iframeInstance = $('<iframe name="iframeHeader" id="iframeHeader"></iframe>');
iframeInstance.css('display', 'none');
iframeInstance.attr('width', '1300');
iframeInstance.attr('height', '1300');
iframeInstance.attr('scrolling', 'no');
iframeInstance.attr('frameBorder', '0');
iframeInstance.attr('align', 'center');
iframeInstance.attr('valign', 'top');
iframeInstance.attr('marginwidth', '0');
iframeInstance.attr('marginheight', '0');
@siddharth-pandey
siddharth-pandey / gist:9467870
Created March 10, 2014 16:01
sessionwrapper above asp.net session
//(Updated for completeness)
//You can access session variables from any page or control using Session["loginId"] and from any class (e.g. from inside a class library), using System.Web.HttpContext.Current.Session["loginId"].
//But please read on for my original answer...
//I always use a wrapper class around the ASP.NET session to simplify access to session variables:
public class MySession
{
// private constructor
private MySession()
{
private List<string> SetupSelectionKeysForDisplay(
IPagedList<KeyValuePair<int, Dictionary<string, string>>> dataValuPagedList)
{
string selectionKey = string.Empty;
string exp = "<(.*?)>";
var reg = new Regex(exp);
MatchCollection matches = Regex.Matches(SelectionKeys, exp, RegexOptions.IgnoreCase);
IEnumerator en = matches.GetEnumerator();
[Thu Apr 24 2014 13:52:39 GMT+0100 (GMT Daylight Time)] #shell 404 Not Found get /Account/Login#/login
Error {message: "404 Not Found get /Account/Login#/login ", stack: "Error↵ at Object.Sammy.Application.$.extend.err…/localhost:36141/Scripts/Vendor/require.js:132:23"}
message: "404 Not Found get /Account/Login#/login "
stack: "Error↵ at Object.Sammy.Application.$.extend.error (http://localhost:36141/Scripts/Vendor/sammy-0.7.4.js:1346:47)↵ at Object.Sammy.Application.$.extend.notFound (http://localhost:36141/Scripts/Vendor/sammy-0.7.4.js:1335:22)↵ at Object.Sammy.Application.$.extend.runRoute (http://localhost:36141/Scripts/Vendor/sammy-0.7.4.js:1179:21)↵ at Object.Sammy.Application.$.extend._checkLocation (http://localhost:36141/Scripts/Vendor/sammy-0.7.4.js:1365:25)↵ at Object.Sammy.Application.$.extend.run (http://localhost:36141/Scripts/Vendor/sammy-0.7.4.js:971:12)↵ at http://localhost:36141/Scripts/App/common.js:36:19↵ at Object.context.execCb (http://localhost:36141/Scripts/V