This is just a spot to keep miscellaneous links. It also shows you what a geek I am.
Tuesday, January 15, 2013
Finding jQuery Event Handlers with Visual Event
Monday, April 02, 2012
10 Value Proposition Examples
'via Blog this'
Tuesday, March 20, 2012
Using Backbone.js with CoffeeScript | Atomic Spin
Monday, January 09, 2012
Wednesday, November 23, 2011
MVC3 app_code directory
I just found out from K. Scott Allen’s MVC3 training video on Pluralsight that the app_code directory in MVC3 is alive and well. Basically the Razor helpers here are pre-compiled and can be accessed globally in the application.
Apparently the usage in a Razor page is as follows:
@Common.Script(“myscript.js”, Url)
Note to self: compare and contrast with shared “editor” partial views.
Note: I composed this post with Windows Live Writer 2011 but it doesn’t seem to play well with Blogger’s own editor. ¡QuĂ© pena!
Tuesday, October 25, 2011
MVC3 ModelState and overwriting model properties
UPDATE 11/10/2011:
This only applies to values passed in via a POST (or a GET?) that you're attempting to override by changing the corresponding fields in the view model.
Wednesday, October 19, 2011
How To: Reset Identity column in SQL Server
Thursday, October 13, 2011
RegExes for replacing MVC3 hard-coded hrefs with @Url.Content hrefs
My app is sprinkled with lots of links like this:
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
So the following search and replace with RegExes will work:
| Find what: | "\.\./\.\.{/[^"]*}" |
| Replace with: | "@Url.Content("~\1")" |
Include the quotes, and be sure to select "Use regular expressions."
Note that the consistent relative path "../../" must be changed as per your circumstances.
UPDATE on 11/2/11:
Now, according to this article, I see that Url.Content is supposed to be better anyway.
Tuesday, September 06, 2011
Wednesday, July 13, 2011
WCF Notes
To discover WCF services, make sure that https is turned off. This is done in two places, apparently:
- In the binding, on the Security tab, Mode property, make sure the property is not set to “Transport”.
- In the service behaviors, serviceMetadata, make sure httpsGetEnabled is set to false and that httpsGetEnabled is set to true.
When you’re done, turn those things back on again.
Common Design Patterns Resources : Steve Smith's Blog
Monday, July 11, 2011
Irony - .NET Language Implementation Kit.
Thursday, June 23, 2011
Cleaning up POSTs in ASP.NET MVC | Jimmy Bogard's Blog
"What we see over and over and over again is a similar pattern of:
[HttpPost] public ActionResult Edit(SomeEditModel form) { if (IsNotValid) { return ShowAView(form); } DoActualWork(); return RedirectToSuccessPage(); }
Where all the things in red are things that change from POST action to POST action."
Friday, June 10, 2011
How to replace all automatic properties of string type with a string type which is never null
In Visual Studio's Find and Replace dialog, type the following in the "Find what:" field:
public string \{:i\} \{ get; set; \}
Type this into the "Replace with" field:
private string _\1;\npublic string \1 \{\nget \{ return _\1 ?? ""; \}\nset \{ _\1 = value; \}\n\}
This pattern of performing a test in the getter versus the setter guarantees that it will never be null, and is the pattern used in the TextBox web control's Text property.
Afterwards you'll want to reformat the code, and possibly rename the backing fields, e.g. _FirstName, to be more camel-cased instead of being Pascal-cased(-like), e.g. _firstName instead of _FirstName.
Thursday, June 09, 2011
Date & Time Formats on the Web
Date & Time Formats on the Web: "There are several different formats used in different places in the technologies of the World Wide Web to represent dates, times and date/time combinations (hereafter collectively referred to as “datetimes” unless a distinction has to be made). This document presents a survey of the most significant, details which formats are mandated by the key technologies of the web, and offers advice for deciding what formats you should use in your own web applications."
Wednesday, May 11, 2011
Josh Reed Schramm - Software Development Thoughts And Opinions - Blog - Unit Testing Role Based Security w/ ASP.Net MVC
Josh Reed Schramm - Software Development Thoughts And Opinions - Blog - Unit Testing Role Based Security w/ ASP.Net MVC: "I took Paul's code and turned it into a series of three controller extension methods which verify if the entire controller requires authorization, a particular method requires authorization or if a particular method requires a given role (i have not yet written the obvious 4th case - an entire controller requires a given role but it should be trivial.)"
Tuesday, May 10, 2011
Compiling MVC Views In A Build Environment
But if you created your project using an older version of ASP.NET MVC including ASP.NET MVC 3 RTM (the one before the Tools Update), your csproj/vbproj file will still have this bug."