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
var optionList = DynamicModel.TypeOfRoom; // TypeOfRoom is the check-box List | |
//Multiple Checkboxes selected | |
if (DynamicModel.TypeOfRoom.GetType() == typeof(Umbraco.Framework.Dynamics.BendyObject)){ | |
var options = DynamicModel.TypeOfRoom.__KeyedChildren; | |
foreach(var kv in options){ | |
RoomType is -- > @kv.Value | |
} | |
} |
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
Mvc 3.0 project that hosts my Services using Service stack | |
Same MVc 3.0 project that holds my controllers responsible for generating the Request Token and Access Token for Oauth authentication | |
In the same MVC project I have an AccountController that my secure services are directed to its “login” action through [Authenticate(HtmlRedirect = "/account/login")] | |
Currently the RequestTokenController returns a hard coded “code” for all requests and the AccessTokenController a hardcoded “access_code” | |
They achieve this through simple redirection to the redirect_uri which is <baseURL>/auth/<provider> | |
As in the following | |
Response.Redirect(redirect_uri + "?code=4512391789087"); |
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
taskkill /IM WebDev.WebServer20.exe /F | |
taskkill /IM WebDev.WebServer40.exe /F | |
/* in large VS solutions we might need to start loads of WebDev instances. | |
The above script will kill all*/ |
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
Delete all the bin and obj folders in a solution 2012: | |
Right-click on the solution in Solution Explorer | |
Open Command Prompt | |
Run powershell | |
Paste and run : | |
Get-ChildItem -include bin,obj -recu -Force | remove-item -force -recurse |
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
// Usage in HTML | |
// <div data-bind="dump: $data"></div> | |
// <div data-bind="dump: $root.results"></div> (if results was an observable/observableArray) | |
// <div data-bind="dump: $root.results()[0].someProperty"></div> (first items property) | |
ko.bindingHandlers.dump = { | |
init: function (element, valueAccessor, allBindingsAccessor, viewmodel, bindingContext) { | |
var context = valueAccessor(); | |
var allBindings = allBindingsAccessor(); | |
var pre = document.createElement('pre'); |
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
ko.bindingHandlers.typeahead = { | |
init: function (element, valueAccessor) { | |
var observableSource = valueAccessor(); | |
var elem = $(element)[0]; | |
var options = { | |
source: ko.utils.unwrapObservable(observableSource), | |
items : 4 | |
}; |
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
//************* HTML ***************************** | |
<input class="typeahead form-control" | |
type="text" | |
placeholder="Fnet User Lookup"> | |
//************* JS ***************************** | |
$('.typeahead').typeahead({ | |
remote: { | |
url: myApp.rootPath + 'user/AutocompleteUser?query=%query', |
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
<select data-placeholder="Select item" data-bind="chosen: { chosenOption: { allow_single_deselect: true }, source: clusters, valueProp: 'Id', selectedValue: selectedCluster, displayProp: 'Name' }"></select> | |
<!-- | |
where clusters is an observable array of objects with properties Id,Name | |
source: clusters, | |
valueProp: 'Id', | |
selectedValue: selectedCluster, | |
displayProp: 'Name' | |
--> |
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
window.myApp = window.myApp || {}; | |
(function (ns) { | |
var rootPath; | |
ns.rootPath = rootPath; | |
}(window.myApp)); | |
(function (ns) { | |
var viewModelHelper = function () { |
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
// Avoid `console` errors in browsers that lack a console. | |
(function() { | |
var method; | |
var noop = function () {}; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', | |
'timeStamp', 'trace', 'warn' | |
]; |
OlderNewer