ASP.Net: GridView control and combobox woes part 2
<p>This is a follow up to: <a href="http://stackoverflow.com/questions/7637920/asp-net-gridview-control-and-combobox-woes">ASP.Net: GridView control and combobox woes</a></p>

<p>I've implemented my code as kd7 has answered but I'm getting a "System.NullReferenceException: Object reference not set to an instance of an object." I've simplified the code as follows:</p>

<p>Event handler for the button click:</p>

<pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
{
    ViewState["MyKey"] = "Test";
}
</code></pre>

<p>The Page_Load now has:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    if (IsPostBack)
    {
        txtDisplay.Text = ViewState["MyKey"].ToString();
    }
}
</code></pre>

<p><strong>My question is:</strong> Why is ViewState["MyKey"] coming back as null and causing a NullReference exception?</p>

<p><strong>Please note that the code above is only a simplified version of what I'm trying to do. Please see the previous question given in the first line of this question to see full details.</strong></p>

<p>Any suggestions?</p>
