One way object binding in JS

This is something I've been putting together this weekend. Due to the fact, that ASP.NET is quite reluctant to get an array of results, I've devised an alternative way of sending data to the server via Web.API. There are already several large frameworks that handle data-binding like Knockout and AngularJS, but these are rather heavy...

InverseProperty records not being savedin the database

In the code-first approach you can easily save object across multiple tables. This is great. However, today I tried saving an object with a set of other records:

In my controller I had simply:

However, the Items where not actually saved in the database. I just changed IEnumerbale to List and it worked...

Publishing WCF Web Service on IIS

Today, I will show you how to to publish WCF Web Service on IIS. I assume your have a working version of your WCF on IIS Express and you want to "publish" it. Step 1 - Install IIS Go to: Control Panel Programs and Features Turn Windows Features On and Off There are 4 things...

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.

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,...

Displaying an image from binary source (like a database)

Today I had to display an image from the database on the website. Here is the code:

Splitting Web.config into multiple files

Reading large XML isn't fun and that's kind of what started happening to my web.config file: tracing, entity framework, database connection strings, service endpoints definition etc, etc, etc... Thankfully there is a way of splitting the web.config into multiple files so that it is easier to read and modify. Create new config file: preferably with...

Invalid Cast Exception with Nested Master Pages

System.InvalidCastException is apparently quite a common error in Nested Master Pages. Quite frankly, the problem seems to be completely random:

I solved my particular problem by adding batch="false" to the compilation tag:

This has some implication on performence and you can read more about it here. Update: 2 weeks later I was still...

ASP.NET Submit button not working (unresponsive)

ASP.NET Forms are a thing of the past... Or are they? Well... I was trying in all my power to do a cross-site data submit. Interestingly enough, the button simply didn't work. Literally, You click it and nothing happens. I did manage to fix it. How?

I removed and that fixed it.