Monday, May 19, 2014

Not your father's embedded code blocks

ASPX files (ASP.NET) now use many more prefixes for inline (aka embedded) code blocks.
see: http://support.microsoft.com/kb/976112

<% ... %>
<%= ... %>
<%@ ... %>
<%# ... %>
<%$ ... %>
<%-- ... %>


And naturally they're difficult strings to Google for.
You should already know the equal sign is a shortcut for response.write, and the @ (at-sign) is for DIRECTIVES.
The complete list of directives, of which you should be familiar with the Page, is:
The ASP.NET page framework supports the following directives:
@ Page Defines page-specific attributes that are used by the ASP.NET page parser and compiler. Can be included only in .aspx files.
*This directive name can be used only in ASP.NET Web Form pages.

@ Control Defines control-specific attributes that are used by the ASP.NET page parser and compiler. Can be included only in .ascx files (user controls).
*This directive name can be used only in User Control files.

@ Import Explicitly imports a namespace into a page or into a user control.

@ Implements Declaratively indicates that a page or a user control implements a specified .NET Framework interface.

@ Register Associates aliases with namespaces and with class names. This enables user controls and custom server controls to be rendered when they are included in a requested page or user control.

@ Assembly Links an assembly to the current page during compilation. It makes all the assembly's classes and interfaces available for use on the page.

@ Master Identifies an ASP.NET master page.

@ WebHandler Identifies an ASP.NET IHttpHandler page.

@ PreviousPageType Provides a way to obtain strong typing against the previous page as accessed through the PreviousPage property.

@ MasterType Assigns a class name to the Master property of an ASP.NET page. Provides a way to create a strongly typed reference to the ASP.NET master page.

@ OutputCache Declaratively controls the output caching policies of a page or of a user control.

@ Reference Declaratively links a page or user control to the current page or user control.

The hash (number sign), # , is for data-binding expressions.

The dollar sign , $ , is for CONFIGURATION FILE, settings access, though Microsoft names this 'expression builder' usage.

Flashback: Where is Adventure Works sample database?

Many tutorials suppose you have a copy of Adventure Works SQL database at the ready. If not installed by default, it is not so easy to find anymore.
The latest link I have for it is:
http://msftdbprodsamples.codeplex.com/downloads/get/106391

Other links will take you to a page for SQL Server 2008 SR4, so just be sure to look for the download below it for Adventure Works.

The file is called:

SQL2008.AdventureWorksLT2008_Only_Database.zip

Thursday, May 15, 2014

Where can I find System.Web.MVC dll in a system where MVC is installed?

The default folder would be like the following:

MVC 5
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll

MVC 4
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll

MVC 3
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll

MVC 2
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll

Thursday, April 24, 2014

Revisiting the Past: SQL Server 2005 setup

So you've installed SQL Server 2005, pretty much using the default options. You load up Management Studio, try to connect to the local instance, and you get an error message saying it cannot be located. 

Chances are your SQL Server Browser service was disabled by default (I believe this is a security measure).  Also, you should refer to your local machine as localhost, not local, nor (localhost), which you'll see in some connection strings and is apt to confuse you.



Monday, April 14, 2014

Dependency Injection

What is the Unity.MVC3 library, I wonder....


"Dependency Injection" is a 25-dollar term for a 5-cent concept. [...] Dependency injection means giving an object its instance variables. [...] "

Hint: It is mostly just to making TESTING easier.

UNIT testing. UNITY. Get it?

Tuesday, April 1, 2014

Mobile Blogspot Fail

2014(5)

2013(21)

2012(16)

2011(6)

2010(33)

2009(4)

2008(9)

2007(34)

Friday, February 21, 2014

Refreshing Job Portal

It is called HIRED. They advertise on LinkedIn.  Jury is still out, but see for yourself:

http://join.hired.com/x/u13yuR