System.NullReferenceException: Object reference not set to an instance of an object MVC 2
I have an MVC 2 application which runs perfectly on my workstation and on 1 of 3 servers. 


The Server builds are Windows Server 2003 with IIS 7. A majority of the application works however on one View I have a button which when pressed submits a  Form. I have this mechanism of posting back on several other pages, however when I try to run the application on two of the three servers I get an error message "Object reference not set to an instance of an object."  This makes absolutely no sense to me as it works locally and also on 1 of the 3 Servers. 

When I look closer into the issue it seems not to be creating an instance of the Model. 


I have copied the stack trace below. Can anyone HELP!!!!  


______________________________________________________________________________________

    [NullReferenceException: Object reference not set to an instance of an object.]
       ASP.areas_campaign_views_allbranchcampaign_aspx.__RenderCampaignSubMenus(HtmlTextWriter __w, Control parameterContainer) in c:\DistributionDatabase\Areas\Campaign\Views\AllBranchCampaign.aspx:59
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       ASP.shared_distributiondb_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\DistributionDatabase\Shared\DistributionDb.Master:134
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

 


System.NullReferenceException: Object reference not set to an instance of an object MVC 2
===

I have an MVC 2 application which runs perfectly on my workstation and on 1 of 3 servers. 


The Server builds are Windows Server 2003 with IIS 7. A majority of the application works however on one View I have a button which when pressed submits a  Form. I have this mechanism of posting back on several other pages, however when I try to run the application on two of the three servers I get an error message "Object reference not set to an instance of an object."  This makes absolutely no sense to me as it works locally and also on 1 of the 3 Servers. 

When I look closer into the issue it seems not to be creating an instance of the Model. 


I have copied the stack trace below. Can anyone HELP!!!!  


______________________________________________________________________________________

    [NullReferenceException: Object reference not set to an instance of an object.]
       ASP.areas_campaign_views_allbranchcampaign_aspx.__RenderCampaignSubMenus(HtmlTextWriter __w, Control parameterContainer) in c:\DistributionDatabase\Areas\Campaign\Views\AllBranchCampaign.aspx:59
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       ASP.shared_distributiondb_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\DistributionDatabase\Shared\DistributionDb.Master:134
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

 

