Format:
Recent snippets for: Rick Strahl
using System; using System.Collections.Generic; using System.Linq; using System.Dynamic; using System.Reflection; namespace Westwind.Utilities { /// <summary> /// Class that provides extensible properties and methods. This
210 Views
1 comments
<!DOCTYPE html> <html> <head> <style> .boxshadow { box-shadow: 4px 4px 5px #535353; } .roundbox {
231 Views
no comments
namespace Westwind.Utilities.Data { /// <summary> /// This class provides an easy way to turn a DataRow /// into a Dynamic object that supports direct property /// access to the DataRow fields. /// /// The class also automatically fixes up DbNull values /// (null into .NET and DbNUll to DataRow) /// </summary>
188 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; namespace Westwind.Web.Services { /// <summary> /// Implements the Gravatar API for retrieving a Gravatar image to display
216 Views
2 comments
(function ($) { $.fn.timeKeys = function (options) { /// <summary> /// Attaches a set of hotkeys to time fields /// + Add minute - subtract minute /// H Subtract Hour R Add houR /// ? Show keys /// </summary> /// <param name="options" type="object">
271 Views
no comments
public class Expando : DynamicObject { dynamic Instance; Dictionary<string, dynamic> ExtraProperties = new Dictionary<string, dynamic>(); public Expando(object instance) { Instance = instance; }
231 Views
no comments
Type ElementType = GetArrayType(ArrayType); if (IsIDictionary) { if (ArrayType.IsGenericType) { var keyType = ArrayType.GetGenericArguments()[0]; var valueType = ArrayType.GetGenericArguments()[1]; ElementType = typeof(keyvalue<,>).MakeGenericType(keyType, valueType); } }
172 Views
no comments
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title></title> <style> .bigbutton { background: #1e5799; /* Old browsers */ color: White;
65 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Threading; namespace Westwind.Utilities { /// <summary>
229 Views
no comments
public class ObjectFactory<T> where T: class, new() { ... /// <summary> /// Returns a unique ID for a given type and parameter signature /// </summary> /// <typeparam name="T"></typeparam>
161 Views
1 comments
<!-- webconnection.manifest --> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity name="web" version="8.0.0.0" type="win32" processorArchitecture="x86" />
39 Views
no comments
[TestMethod] public void TestRenamedbContextMenu() { dbContext context = new dbContext(); // Load the first menu Menu menu = context.Menus.FirstOrDefault(); // force a change menu.ModifiedOn = DateTime.Now;
243 Views
no comments
/// <summary> /// Creates a list of a given type from all the rows in a DataReader. /// /// Note this method uses Reflection so this isn't a high performance /// operation, but it can be useful for generic data reader to entity /// conversions on the fly and with anonymous types. /// </summary> /// <typeparam name="TType"></typeparam> /// <param name="reader">An open DataReader that's in position to read</param> /// <param name="fieldsToSkip">Optional - comma delimited list of fields that you don't want to update</param>
494 Views
no comments
FUNCTION ShowEmail( lcRecipient,lcSubject,lcBody ) RETURN GoUrl("mailto:" + lcRecipient + ; "&Subject=" + STRTRAN(UrlEncode(lcSubject),"+"," ") +; "&Body=" + STRTRAN(UrlEncode(lcBody),"+"," ")) **************************************************** FUNCTION GoUrl ****************** *** Author: Rick Strahl *** (c) West Wind Technologies, 1996
57 Views
no comments
/// <summary> /// Internally used Page instance so we can get access to /// a Page instance when no Page might be available. To Access ClientScript etc. /// </summary> private static Page CachedPage { get { if (_CachedPage == null) _CachedPage = new Page();
81 Views
1 comments
var subjectString = @" This works fine: <a href=""_1a904m3mg.htm"" >Help Builder Features</a> This will select the first (non-matching) href and selects through the second - need to avoid this <a href=""_2a904m3mg.htm"" >Help Builder Features</a> asdsad <a href=""_1a904m3mg.htm"" >Help Builder Features</a> Need to also match something like this: <a href=""path/_1a904m3mg.htms"" >Help Builder Features</a>
424 Views
1 comments
if (!JSON) { // Autoload JSON2.js if possible // Note: if using a script loader you may have to explicitly load json2.js // assumes loading from same folder as this script var scripts = $("script"); var src = null; scripts.each(function (i) { src = $(this).attr("src"); if (src && src.toLowerCase().indexOf("serviceproxy.") > -1) { src = src.toLowerCase();
348 Views
no comments
$.ajaxSetup({
converters: { "text json": function (jsonString) {
var res = JSON.parseWithDate(jsonString);
if (res && res.hasOwnProperty("d"))
res = res.d;
return res;
} }
});
224 Views
no comments
<configuration> <system.web> <httpModules> <add name="ScriptCompressionModule" type="Westwind.Web.ScriptCompressionModule,Westwind.Web" /> </httpModules> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules> <add name="ScriptCompressionModule" type="Westwind.Web.ScriptCompressionModule,Westwind.Web" />
296 Views
no comments
<div class="dialog" style="width: 900px;"> <div class="dialog-header">Album Listings</div> <div class="toolbarcontainer" style="text-align: right;"> Artist: <asp:TextBox runat="server" id="txtArtistFilter" style="width: 100px;" /> Album: <asp:TextBox runat="server" ID="txtAlbumFilter" style="width: 100px;"/> <asp:Button runat="server" ID="btnFilterList" Text="Go" /> </div> <div style="overflow-y: scroll;height: 300px; width: 400px; background: cornsilk; float:left">
167 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
