Support Eric Sundwall for Congress

The appointment of Hillary Clinton for Secretary of State, and the subsequent appointment of (former Representative) Kirsten Gillibrand to replace her, has left a void in Congress. A special election is pending – and, if you’re among those eligible to vote in it, you should vote for Eric Sundwall to fill that void.

In the interest of full disclosure, I’ve never met Mr. Sundwall, nor do I pretend to know him personally. I do know him as the Chairman for the Libertarian Party of New York, and I do support him for the following reasons.

He’s an IT guy. Many readers of my blog are IT people, and as we all know, IT people are typically smart, pragmatic, and results-driven. No doubt Sundwall shares those characteristics.
He’s a small-government guy. Sundwall recognizes the danger in deficit spending (which simply puts the burden of payment to our children), and no doubt would be strongly against the $800-billion (so-called) bailout.
He recognizes the limitations of . . .

→ Read More: Support Eric Sundwall for Congress

Using MonoRail ViewComponents with the Spark view engine

Although I was able to find some documentation and samples (mostly through the unit tests) of how to use a ViewComponent with the Spark view engine, details were sketchy, so I’ll share some quick tips to those who are scratching their heads as I was.

Using a block ViewComponent

Support for block view components is pretty evident in Spark, as shown in the following example, which illustrates the use of the AuthenticatedContent view component.

<authenticatedcontent>
<logged>
This content is shown when the user is logged in.
</logged>
<notlogged>
This content is shown when the user is NOT logged in.
</notlogged>
</authenticatedcontent>

Using the CaptureFor ViewComponent

The CaptureFor component is one useful way to allow a sub-view to “inject” data into a layout. I use this all the time to allow a rescue page to change the page title when an error occurs.

On your layout page, you inject the page title as you normally would (so a controller can inject it via the property bag).

<title>ComputerSims Baseball: $!{ViewData["PageTitle"]}</title>

In the view, the . . .

→ Read More: Using MonoRail ViewComponents with the Spark view engine