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
@using System.Web | |
@using System.Web.Security | |
@helper LoginForm() | |
{ | |
<form method="post"> | |
<div><label for="name">Username:</label> | |
<input type="text" id="username" name="username"/></div> | |
<div><label for="password">Password:</label> | |
<input type="password" id="password" name="password"/></div> | |
<div><input type="submit" id="submit" name="submit" value="login"/></div> |
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
@using umbraco.cms.businesslogic.web | |
@* A Razor script to add a basic comment function to Umbraco pages | |
You need a document type called Comment with a textstring property | |
called commentName and a textbox multiple property called commentMessage | |
You also need to allow the Comment document type as child document type | |
to your textpage document type. | |
Create this script with a macro and add it below the bodyText in your | |
template(s) *@ |
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
@using System.Text | |
@using System.Reflection | |
@functions { | |
private const string Username = "your email"; | |
private const string APIKey = "your api-key"; | |
private const string Sender = "your email"; | |
public static string ToYaml(object o) | |
{ |
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
/// | |
/// This is a first attempt to make some useful extension methods to dynamic node and dynamic node list | |
/// Comments and collab is more than welcome! | |
/// | |
/// Ref (Gareth Evans): | |
/// http://umbraco.com/follow-us/blog-archive/2011/2/28/umbraco-razor-feature-walkthrough-%E2%80%93-part-3 | |
/// | |
using System; | |
using System.Collections.Generic; |
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
using System; | |
using System.Collections.Generic; | |
using System.Web; | |
using System.Linq; | |
using SisoDb; | |
/// <summary> | |
/// Requires the NuGet packages Nancy.Hosting.Aspnet and SisoDb | |
/// and a local Database in .\Sqlexpress called sisodemo | |
/// </summary> |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using FluentValidation; | |
using System.Collections.Specialized; | |
namespace HtmlFormHelpers | |
{ |
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
EDIT : HtmlFormsHelper has evolved to https://github.com/joeriks/DynaForms | |
@using HtmlFormHelpers | |
@{ | |
var form = new HtmlFormDescriptor("project-form", project); | |
// Create a new project, or get it from the database (using PetaPoco in this example). | |
Project project; |
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 sendEmailTo = "me@mysite.com"; | |
var emailErrorSubject = "ERROR on your web site"; | |
function isCellEmpty(cellData) { | |
return typeof(cellData) == "string" && cellData == ""; | |
} | |
function autotest_hourly() { | |
checkUrls("Autotest"); | |
} |
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 arry = new[] { | |
new { | |
id=Guid.NewGuid(), | |
name="one", | |
done=false | |
}, | |
new { | |
id=Guid.NewGuid(), | |
name="two", |
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
static void Main(string[] args) | |
{ | |
// sample Callback in C# | |
string message = "Done!"; | |
startRunner(finished, message); | |
} | |
static public void finished(string message) | |
{ | |
Console.Write(message); | |
} |
OlderNewer