"Use the new keyword to create an object" instance error
<p>I have a masterpage file which is called Masterpage.master which works fine with all my aspx pages except aspx pages in which I try to instantiate stuff in the Page_Load method in the codebehind file. </p>

<p>The aspx file called ManageRoles.aspx looks like this - </p>

<pre><code>            &lt;%@ Page Language="C#" 
            AutoEventWireup="true" 
            CodeBehind="ManageRoles.aspx.cs" 
            Inherits="eservice.ManageRoles"
             MasterPageFile="~/MasterPage.Master"

            %&gt;


            &lt;asp:Content ID="Content2"  
                ContentPlaceHolderID="ContentPlaceHolder1" 
                runat="server"&gt;
                &lt;!-- Start of roles --&gt;
                &lt;h3&gt;
                    Manage Roles&lt;/h3&gt;


                &lt;asp:Label ID="Msg" ForeColor="maroon" runat="server" /&gt;
                &lt;br /&gt;

                &lt;!-- End of roles --&gt;
                &lt;asp:LoginView ID="LoginView2" runat="server"&gt;


                    &lt;LoggedInTemplate&gt;
                         &lt;p id="backtoblog"&gt;&lt;/p&gt;



                &lt;!-- End of roles --&gt;

                    &lt;/LoggedInTemplate&gt;

                    &lt;AnonymousTemplate&gt;

                    &lt;/AnonymousTemplate&gt;


                    &lt;/asp:LoginView&gt;

            &lt;/asp:Content&gt;
</code></pre>

<p>and the  code-behind file called ManageRoles.aspx.cs looks like this - </p>

<pre><code>            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Web;
            using System.Web.UI;
            using System.Web.UI.WebControls;
            using System.Web.Security;



            namespace eservice
            {
                public partial class ManageRoles : System.Web.UI.Page
                {
                    private string[] rolesArray;
                    private string[] usersInRole;
                    MembershipUserCollection users;



                    protected void Page_Load(object sender, EventArgs e)
                    {
                        // clear the Msg label on each visit
                        Msg.Text = string.Empty;


                    }

                }
            }
</code></pre>

<p>The Masterpage.master file contains a content section like this - </p>

<pre><code>            &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt;

                    &lt;/asp:ContentPlaceHolder&gt;
</code></pre>

<p>This is a web application project and it builds fine but throws a runtime exception when I click on the link for ManageRoles.aspx </p>

<p>I am getting the following exception - </p>

<p>System.NullReferenceException was unhandled by user code
  Message="Object reference not set to an instance of an object."
  Source="eservice"
  StackTrace:
       at eservice.ManageRoles.Page_Load(Object sender, EventArgs e) in C:\Users\das.arunabh\Documents\Visual Studio 2008\Projects\ESERVICE_SOLUTION-MAIN\eservice\eservice\ManageRoles.aspx.cs:line 24
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: </p>
