Skip to content

Instantly share code, notes, and snippets.

View csharpforevermore's full-sized avatar
🏠
Working from home

Randle csharpforevermore

🏠
Working from home
View GitHub Profile
@jkarsrud
jkarsrud / controller.cs
Created August 22, 2013 14:36
Setting up and using the UmbracoHelper inside a custom controller
public class HomeController : Controller
{
private readonly UmbracoHelper _umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
public ActionResult Index()
{
var node = _umbracoHelper.TypedContent(1000);
return View(node);
}
}
/// <summary>
/// Handles the login form when user posts the form/attempts to login
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public ActionResult HandleLogin(LoginViewModel model)
{
if (!ModelState.IsValid)
{
@eyston
eyston / controller.js
Created June 24, 2013 17:11
angular typeahead
angular.module('ymusica').controller('AlbumSearch', ['$scope', 'Albums', 'Artists', '$q', function($scope, albums, artists, $q) {
$scope.albums = [];
$scope.artists = [];
var terms = new Rx.Subject();
$scope.searchMusic = terms.onNext.bind(terms);
terms.sample(250)
@sphingu
sphingu / MVC_InterView_Questions.md
Created June 19, 2013 09:18
MVC Interview Questions

Interview Question


1.In which assembly is the MVC framework defined? System.Web.Mvc

2.What is ViewData, ViewBag and TempData?

  MVC offers Three options for passing data from controller to View and  in next request. 
ViewData & ViewBag are almost similar.
  	Short life means value becomes null when redirection occurs.
		It’s a communication mechanism within the server call.
Difference between ViewBag & ViewData:
@samyakbhuta
samyakbhuta / JavascriptReferences.md
Last active June 1, 2018 00:42
#javascript #reference
@model UmbracoLogin.MemberLoginModel
@if (User.Identity.IsAuthenticated)
{
<p>Logged in: @User.Identity.Name</p>
<p>@Html.ActionLink("Log out", "MemberLogout", "MemberLoginSurface")</p>
}
else
{
using (Html.BeginUmbracoForm("MemberLogin", "MemberLoginSurface"))
{
anonymous
anonymous / MemberLogin.cshtml
Created December 19, 2012 11:47
A Umbraco 4.10+ SurfaceController based Login Form
@model UmbracoLogin.MemberLoginModel
@if (User.Identity.IsAuthenticated)
{
<p>Logged in: @User.Identity.Name</p>
<p>@Html.ActionLink("Log out", "MemberLogout", "MemberLoginSurface")</p>
}
else
{
using (Html.BeginUmbracoForm("MemberLogin", "MemberLoginSurface"))
{
@kjelelokk
kjelelokk / dojo_epiComponent.cs
Created November 29, 2012 11:46
Dojo episerver component
using EPiServer.Shell.ViewComposition;
using EPiServer.Shell.Web;
using EPiServer.Cms.Shell;
using EPiServer.Cms.Shell.UI;
namespace testepi7.MyWidgets
{
[Component(
PlugInAreas = "/episerver/cms/assets",
Categories = "cms",