The first step is to figure out what is null. Usually the error message tells you exactly what is null. Once you know what is null then you can backtrack to figure out why the item is not initialized. Unfortunately, you did not include all the relevant code like the actual markup and how the model is populated. Since #btn is a submit button it can cause a POST and a full page refresh depending on the markup design. Maybe you just need to cancel the POST? Otherwise, share enough code to reproduce this issue so the community is not forced to guess.
$(function () {
$("#btn").click(function (e) {
e.preventDefault();