Skip to content

Instantly share code, notes, and snippets.

@rustd
rustd / aspnet46
Last active August 29, 2015 14:20
aspnet46 modelbinding
<%--
Web Forms page calling a select method to model bind to a list of students.
The GridView uses Model Binding to bind to Student type in your app.
To use Async Model Binding, mark your page with Async=True attribute.
--%>
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" Async="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication226._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<asp:GridView runat="server" ID="studentsGrid"
@rustd
rustd / AzureRedisCacheInfo
Created March 4, 2015 01:41
Azure Redis Cache Info
1. Cache Name
2. Cache Size
3. Precise Time of errors (including Timezone)
4. Exception messages with full stack trace
5. Number and type of client instances (e.g. web site, web role, worker role, VM)
6. Public Virtual IP (VIP) Address of client deployments
7. Version of StackExchange.Redis (and Microsoft.Web.RedisSessionStateProvider if applicable)
8. Code snippet showing how you are configuring and using the ConnectionMultiplexer object. Are you sharing a single instance of ConnectionMultiplexer across the whole client process?
9. In what region(s) are your cache service and clients?
10. Did anything change in your client around the time of the error? Were you scaling the number of client instances up or down, or deploying a new version of the client? Does your client have auto-scale enabled?
@rustd
rustd / JedisRedisCache
Last active August 29, 2015 14:14
Use Jedis client to connet to Azure Redis Cache
package com.mycompany.app;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisShardInfo;
/**
* Make sure your turn on non SSL port in Azure Redis using the Configuration section in the Azure portal.
* Hello world!
* mvn compile
* mvn exec:java
*/
@rustd
rustd / IdentityConsoleSeeding.cs
Last active September 24, 2020 07:25
ASP.NET Identity Seed a database in a console application
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity;
using System;
using System.Data.Entity;
using System.Threading.Tasks;
namespace SeedDb
{
@rustd
rustd / ASP.NET Identity & Security.md
Last active August 29, 2015 13:57
Information about ASP.NET Identity & Security

In Visual Studio 2013 we revamped the membership and authentication system for ASP.NET web developers.

We added ASP.NET Identity which is a modern membership system for ASP.NET applications. It includes features such as Two-Factor Authentication which is becoming a common practise for securing web applications. For more information on why did we create ASP.NET Identity please read http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity

As part of Microsoft OWIN Components (Katana) We also added support for OWIN and added OWIN middlewares such as OWIN Cookies (and more) which replaces the FormsAuthentication module. The move to be OWIN compliant Framework will allow us to build apps which are more flexible, portable, lightweight, and provide better performance. For more information please read http://www.asp.net/aspnet/overview/owin-and-katana/an-overview-of-project-katana

We are in the processing of adding documentation for these changes but we