Archive for the 'website' Category

ASP.NET GlobalFilters, except this one page

If you are an ASP.NET web dev, you probably know about GlobalFilters.  You can apply an ActionFilter attribute globally.  It’s super useful for things like RequireHttps.  Unless you have one page that you want to exclude from that requirement.  Maybe you have AuthorizeAttribute sprinkled around because everything on your site is secure except, obviously, the login page.  Maybe, like me, you have a health check page that you want accessible via HTTP, while everything else is forced to HTTPS, or maybe there is some other use case.  At any rate, I found a good solution, implemented it, and then had to remove it because things took a different direction.  So, I am writing this mostly so I don’t forget about it, because it’s a pattern that I’ve wondered about before and never found a good answer.

Searching for what others have done in this case is actually a little difficult.  The terms for what you want to accomplish – filter, exclude, except – are all pretty generic.  The specific ASP.NET classes and fields are subjects of many unrelated articles, so that doesn’t really help.  Phil Haack has an interesting approach, but ultimately, I prefer declaring rules or exceptions inline as attributes. What I had adapted, before pulling it back out, was a nice approach outlined by Ori Calvo.

If you need to implement a similar setup, check out both approaches, and see if one of them will work for you!

Advertisements

Personal Websites

I just re-registered the mattschuette.com domain after a few weeks of it being expired and nearly past the grace period. It got me thinking about what a personal website is for these days. We have several social websites for day-to-day thoughts, text messaging or maybe an IM for more immediate needs, flickr or other sites for pictures (though probably just on a social network), and LinkedIn for resumes. What is left?

Why do people have personal websites now? If you have code to share, put it on github or wherever. I guess there’s the about page, but static content is boring. I enjoyed maintaining my own webserver, but what’s the point? For that matter, why have a blog? Most of my posts, not that there are many, lately are just rants or screeds, and that gets old after maybe two.

So I’m honestly asking any friends still stopping by here or random passers-by — what are the reasons? What is interesting to read about? What content rises above just ego stroking?

What’s up with Matt?

You may notice that my website has been down for a long time, and is now just a placeholder (thanks for the hosting, Mikey).  Well, late last year (October or November) my web server died.  I think the processor overheated.  It’s pretty old hardware, and parts are hard to come by or significantly overpriced.  I was looking for a cheap (read free) replacement box, but haven’t really found one yet.  So, that’s why I don’t have a web server.  Then, a month or two ago, my main computer crapped out.  I think the processor was zapped when the PSU went out.  PSU has been replaced, new processor and heat sink ordered.

While all of that was happening, Sam has been growing and doing all kinds of things that we’ve been wanting to keep track of.  We take tons of pictures, but Nikki was also wanting to write some thoughts down.  I had initially hoped to get my web server back up and host it and all that, but I just didn’t have the time.  I checked out a couple free blogging hosts, and settled on WordPress.  She really seems to like it.  Then I recommended it to my sister, who has been posting pretty prolifically about her English teaching stint in Lithuania.

Having thought of several things to blog about in the past 10 months and not having anywhere to do so, I realized that I should just bite the bullet and use wordpress myself.  Maybe when I get the web server running again I will install the wordpress.org software instead of hosting it here at wordpress.com, but maybe not (having to pay for CSS editing kinda blows, though).


Posts

November 2017
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

del.icio.us bookmarks

Thanks

I would like to thank Mike Hellrich for hosting a couple redirects for me while I sort out my web server problems.