Footer from database in MVC ASP.NET

I've been struggling for a while to find a sensible way of getting the footer. Well... This is where partial views come useful. There are several ways to solve this problem. I've created a controller:

In the Shared folder I've added _FooterPartial.cshtml and in the layout this line:

It worked so awesome.

Overriding onClick event in jQuery

Interesting problem today, I tried to override behaviour of an image. The simple approach of replacing behaviour obviously didn't work:

Neither $("#game-image").removeAttr('onclick'); did anything. There is a function unbind.

This can be followed by the 'overriding' function:

MVC File Upload - Access to the path is denied

Interesting problem occurred yesterday, when I was trying to upload a file to the server. I was getting: Access to the path '' is denied The problem wasn't actually caused by the file upload but by my attempt to create a directory to put that file there. After reading a bunch of answers on StackOverflow,...

ASP.NET Automatic Migrations

Understanding migrations can be a bit tricky. Hopefully, this article will resolve at least some of the questions you might have. First things first - What are migrations? Well... If you built your website using first code approach every time you change your model you need in order to keep the database in sync. There...

findViewById in a fragment

Not quite as simple as it would seem. You can't use onCreate() method because it is called before onViewCreate(). However, you can used onViewCreate, because you inflate your view: hence you have access to it: