Minify and inline CSS for ASP.NET MVC

By Robert Ellison. Updated on Wednesday, April 28, 2021.

Minify and inline CSS for ASP.NET MVC

ASP.NET has a CssMinify class (and a JavaScript variant as well) designed for use in the bundling pipeline. But what if you want to have your CSS minified and inline? Here is an action that is working for me (rendered into a style tag on my _Layout.cshtml using @Html.Action("InlineCss", "Home")).

Note that I'm using this to inline CSS for this blog. The pages are cached so I'm not worried about how well this action performs. My blog is also basically all landing pages so I'm also not worried about caching a non-inline version for later use, I just drop all the CSS on every page.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Minify and inline CSS for ASP.NET MVC #code #asp.net #mvc #css #inline #minify How to use ASP.NET MVC bundles to inline CSS and JavaScript for high performing landing pages. )

Book reviews for July 2014

By Robert Ellison. Updated on Friday, February 24, 2017.
Web Analytics 2.0: The Art of Online Accountability & Science of Customer Centricity [With CDROM] by Avinash Kaushik

Web Analytics 2.0: The Art of Online Accountability & Science of Customer Centricity [With CDROM] by Avinash Kaushik

5/5

Deep, evergreen advice on web analytics. This book is grounded in the trenches and is full of practical advice and reality. Works well to read all the way through and to dip into for specific topics.

 

The Divide: American Injustice in the Age of the Wealth Gap by Matt Taibbi

The Divide: American Injustice in the Age of the Wealth Gap by Matt Taibbi

5/5

Barnstorming tirade against injustice in the US law enforcement and legal systems. Nothing in here was news to me, but laid out story after story it's breathtaking. Minor welfare infractions leading to jail time, institutionalized fraud ignored. Banks get away with money laundering and theft while in some places standing on the street is a crime. Once you've worked up a full head of rage you realize that Obama is as bad as Bush is nearly as bad as Clinton. The failure is in politics and this book is a depressing catalog of the symptoms.

 

Add your comment...

Related Posts

(All Reviews)

Tedious Feed Update

By Robert Ellison. Updated on Wednesday, February 22, 2017.

Tedious Feed Update

If you subscribe to I Thought He Came With You via RSS please switch to this new feed and delete the old one.

Longer version... this blog has used FeedBurner for ever but I managed to get locked out a couple of years ago. I upgraded to Google Apps for Domains and part of the process was transitioning various services over to a temporary account and then back to the new one. Most of them made it over but FeedBurner got orphaned somehow.

I've emailed, left forum posts etc but no luck. Google doesn't really do customer service so despite actually paying them I seem to be out of luck. Also, Google hates RSS so FeedBurner probably isn't the right long term tool even if I could get back into my account.

I've been meaning to do something about this for a while but as it was working it wasn't a top priority. This changed when my blog got hacked a couple of times in a row - I'm not sure if it was the software (I'd been using BlogEngine.net) or my hosting provider but it's painful to fix and I decided I needed a change. I Thought I Came From You is now running on a home grown platform. It should be more stable, faster (some quick benchmarking suggests twice as fast so far) and not get hacked quite so often.

So switch to http://ithoughthecamewithyou.com/syndication.axd for updates (I can't recommend Feedly highly enough) and delete the old feed. If you have any problems leave a comment below or send me an email.

Add your comment...

Related Posts

(All Etc Posts)

(Published to the Fediverse as: Tedious Feed Update #etc #rss #feed #google #feedburner The I Thought He Came With You RSS feed has moved. Get the new RSS feed here. )

Bay Bridge, Old And New

By Robert Ellison. Updated on Saturday, October 1, 2022.

Bay Bridge, Old And New

Photo of the new span of the Bay Bridge next to the partially demolished old span from the San Francisco Bay.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Bay Bridge, Old And New #photo #baybridge Photo of both eastern spans of the Bay Bridge - the new one and the partially demolished old one. San Francisco Bay, California. )

Book reviews for June 2014

By Robert Ellison. Updated on Friday, February 24, 2017.
Advanced Web Metrics with Google Analytics by Brian Clifton

Advanced Web Metrics with Google Analytics by Brian Clifton

4/5

Very helpful book, but a generation out of date. Does not cover universal analytics or the new user ID collection but is a great foundation as long as you know this. I'll buy the next edition when/if it becomes available.

 

Add your comment...

Related Posts

(All Reviews)

Summer Solstice 2014

By Robert Ellison. Updated on Thursday, November 12, 2015.

Summer Solstice 2014

It's the start of Summer in the Northern Hemisphere, Winter if you live south of the equator or in San Francisco. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Summer Solstice 2014 #code #earth #solstice #northern #summer #winter #estival The exact moment of Summer Solstice 2014 rendered in Catfood Earth. )

Party Limits

By Robert Ellison. Updated on Sunday, November 5, 2023.

Party Limits

What if as well as Term Limits we had Party Limits - the same political party cannot win more than three or four times in a row?

Representative Alan Lowenthal has introduced the Let the People Draw the Lines Act which would seek to prevent gerrymandering by taking redistricting out of the hands of the politicians for the states that haven't done this already (California, Arizona, Washington and Idaho have independent commissions).

This is a good idea, but I'd go further. Let's introduce Term Limits where we don't already have them and then add Party Limits. The same politician can only hold on to their seat for two to three terms and additionally the same party can't hold the seat for more than three to four terms. We break up any kind of political monopoly and reduce the incentive to rig the system to keep the same incumbent in power.

We'd probably get more political diversity as well as fewer career politicians. It's a better solution to daisyworld.

Add your comment...

Related Posts

(All Politics Posts)

(Published to the Fediverse as: Party Limits #politics #politicalreform #partylimits What if as well as limiting the number of consecutive terms for a politician we also did the same for each political party? )

Book reviews for May 2014

By Robert Ellison. Updated on Friday, February 24, 2017.
The Quarry by Iain Banks

The Quarry by Iain Banks

4/5

This was a hard book to start because it's so sad to know that there will never be another Iain [M] Banks novel. I fell in love with his work after picking up The Wasp Factory with some birthday money in Guildford. I had (and loaned and lost) one signed book, Feersum Endjinn, which was the only really awful one. The Quarry was short, better than I thought it would be, not as good as his best. He'll be missed.

 

A Short Gentleman by Jon Canter

A Short Gentleman by Jon Canter

4/5

Unbearably British. Very funny.

 

Add your comment...

Related Posts

(All Reviews)

From Alta Plaza Park

By Robert Ellison. Updated on Saturday, October 1, 2022.

From Alta Plaza Park

San Francisco at night shot from Alta Plaza Park.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: From Alta Plaza Park #photo #sanfrancisco Photo of San Francisco at night as seen from Alta Plaza Park. )

Coyote

By Robert Ellison. Updated on Monday, December 28, 2020.

Coyote

Coyote on Lovers' Lane in The Presidio.

Updated 2014-10-21 22:53:

Presidio Coyote San Francisco

Another Presidio Coyote, this time on the main post.

Updated 2020-01-01 18:19:

Coyote

Two pups playing in Glen Canyon Park.

Updated 2020-10-10 10:28:

Coyote

In the Marin Headlands.

Updated 2020-12-28 09:26:

Coyote

In Glen Canyon Park again.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Coyote #photo #coyote #presidio Photos of coyotes around San Francisco and in the Marin Headlands. )