Null reference exception-control - reference

I get some kind of errors and can't understand why!
[NullReferenceException: Object reference not set to an instance of an object.]
header.Page_Load(Object sender, EventArgs e) +867 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92
IRIPL.Sys5B.Web.cWebPageComponent.OnLoad(EventArgs e) +39 System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

Related

Added additional fields to custom table in Acumatica has caused error. How to resolve?

We added a number of additional fields to a custom table in Acumatica. One of the fields is causing an error. We made change in SQL Server and updated the code. The field having the error is defined in the code:
#region LastRevisionInventoryID
[PXDBInt]
[PXUIField(DisplayName = "Last Revision Inventory ID")]
public int LastRevisionInventoryID { get; set; }
public class lastRevisionInventoryID : IBqlField{}
#endregion
The code validates and publishes but we get the following error when we try to open the screen after adding the fields to the screen.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
_SetValueByOrdinal(ItemBaseDocument , Int32 , Object ,
PXCacheExtension[] ) +1012
PX.Data.PXCache`1.SetValueByOrdinal(TNode data, Int32 ordinal, Object
value, PXCacheExtension[] extensions) +84
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3, Boolean A_4) +1273
[PXException: Error: An error occurred during processing of the field
LastRevisionInventoryID : Object reference not set to an instance of an
object..]
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3, Boolean A_4) +2908
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3) +87
PX.Data.PXCache`1.Insert(IDictionary values) +237
PX.Data.PXGraph.ExecuteInsert(String viewName, IDictionary values,
Object[] parameters) +187
PX.Web.UI.PXBaseDataSource.a(Object[] A_0, Object[] A_1, String[] A_2,
Boolean[] A_3, PXFilterRow[] A_4, DataSourceSelectArguments A_5) +1783
PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName,
DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
+13769
PX.Web.UI.PXDataSource.ExecuteSelect(String viewName,
DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
+211
PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments,
PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback)
+65
PX.Web.UI.PXFormDataProvider.DataBind() +381
PX.Web.UI.PXBoundPanel.PerformSelect() +134
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +138
PX.Web.UI.PXDataViewBar.OnPreRender(EventArgs e) +33
System.Web.UI.Control.PreRenderRecursiveInternal() +162
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6925
Can anyone help?
In Acumatica, all DAC fields must be of a nullable type, Nullable<int> or int? in your case:
#region LastRevisionInventoryID
public abstract class lastRevisionInventoryID : IBqlField { }
[PXDBInt]
[PXUIField(DisplayName = "Last Revision Inventory ID")]
public int? LastRevisionInventoryID { get; set; }
#endregion

How to properly extend APRegister class in Acumatica

I need to add one bool field to table APPayment. Because APPayment is inherited from APRegister I make extension to class APRegister in the following way:
public class APRegisterExt: PXCacheExtension<APRegister>
{
#region UsrPOAllocated
public abstract class usrPOAllocated : IBqlField
{
}
[PXDBBool]
[PXUIField(DisplayName = "Allocated")]
public bool? UsrPOAllocated{ get; set; }
#endregion
}
but then when I navigate to page AP301000, AP302000 I see following error:
Invalid column name 'UsrPOAllocated'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'UsrPOAllocated'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Invalid column name 'UsrPOAllocated'.]
PX.Data.PXSqlDatabaseProvider.a(SqlException A_0, IDbCommand A_1) +765
PX.Data.PXSqlDatabaseProvider.ExecuteReaderInternal(IDbCommand command, CommandBehavior behavior) +357
PX.Data.PXSelectResultEnumerator.System.Collections.IEnumerator.MoveNext() +473
PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter) +6089
PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows) +2651
PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows) +1220
PX.Web.UI.PXBaseDataSource.a(Object[] A_0, Object[] A_1, String[] A_2, Boolean[] A_3, PXFilterRow[] A_4, DataSourceSelectArguments A_5) +218
PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) +13726
PX.Web.UI.PXDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) +149
PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments, PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback) +65
PX.Web.UI.PXFormDataProvider.DataBind() +383
PX.Web.UI.PXBoundPanel.PerformSelect() +135
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +139
PX.Web.UI.PXDataViewBar.OnPreRender(EventArgs e) +33
System.Web.UI.Control.PreRenderRecursiveInternal() +110
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2994
So question is, how to correctly extend classes in Acumatica that is base classes for other entities and implement other interfaces?
And one more question. If I extend base class APRegister, then how to reference in grid additional field with possibility to edit? I mean if I extended APRegister but need to display APPayment elements in grid, then how can I show them with edit option?
Provided code snippet seems to work perfectly fine on a brand new Acumatica website once UsrPOAllocated column was added for the APRegister database table:
public class APRegisterExt : PXCacheExtension<APRegister>
{
#region UsrPOAllocated
public abstract class usrPOAllocated : IBqlField
{
}
[PXDBBool]
[PXUIField(DisplayName = "Allocated")]
public bool? UsrPOAllocated { get; set; }
#endregion
}
Since APInvoice is inherited from APRegister, for every instance of the APInvoice DAC the framework will always initialize all extensions declared for the base APRegister DAC.
Below is a small sample showing how you can access UsrPOAllocated field declared within the APRegister DAC extension inside RowSelected event handler raised for the APInvoice DAC:
public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEntry>
{
public void APInvoice_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
APInvoice invoice = e.Row as APInvoice;
if (invoice == null) return;
var invoiceExt = invoice.GetExtension<APRegisterExt>();
if (invoiceExt.UsrPOAllocated != true)
{
sender.RaiseExceptionHandling<APInvoice.refNbr>(invoice, invoice.RefNbr,
new PXSetPropertyException("Document is not allocated", PXErrorLevel.Warning));
}
else
{
sender.RaiseExceptionHandling<APInvoice.refNbr>(invoice, invoice.RefNbr, null);
}
}
}
The customization from above was created with layout editor:
And this is Aspx, that layout editor generated:
<px:PXCheckBox runat="server" ID="CstPXCheckBox1" DataField="UsrPOAllocated" />

Managing Permissions Issue after SharePoint 2007 to 2013 Migration

I am really struggling with this and any input would be appreciated.
After SharePoint Migration (with the Database Attach method) from 2007->2010->2013 multiple subsites in a sitecollection are having Problems.
Managing Permissions from Site Settings is not possible:
/domain/sitecollection/subsiteA/_layouts/15/people.aspx
/domain/sitecollection/subsiteA/_layouts/15/user.aspx
The Two Pages are Throwing an Error
An unexpected error has occurred:
Log:
Application error when access /_layouts/15/people.aspx, Error=Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlB... a042ca9d-e5a1-3092-22c7-5be152697ad2
...yWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at Sys... a042ca9d-e5a1-3092-22c7-5be152697ad2
...tem.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control roo... a042ca9d-e5a1-3092-22c7-5be152697ad2
...tControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRe... a042ca9d-e5a1-3092-22c7-5be152697ad2
...cursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
Getting Error Message for Exception System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.... a042ca9d-e5a1-3092-22c7-5be152697ad2
...FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive(... a042ca9d-e5a1-3092-22c7-5be152697ad2
...) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
What I've figured out so far:
Groups are there: -/domain/sitecollection/subsiteA/_layouts/15/people.aspx?MembershipGroupId=3898 throws the same Error.
-/domain/sitecollection/_layouts/15/people.aspx?MembershipGroupId=3898 but direct in sitecollection the group is found
Subsites where permissions are working:
/domain/sitecollection/subsiteB/_layouts/15/people.aspx?MembershipGroupId=6618 is displayed correctly,
but when I change the list view from the Default Detail View to another View, the same error occurs.
I have found the Problem and it was not caused by the Migration, it was caused by a Custom Control (Implemented for the BreadCrumb Navigation).
The Control was Implemented from the Example on the Link,
SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
The SPXmlContentMapProvider did cause an exception but not always, just when a SiteCollection had a White Space in the URL, and only if you have navigated to the Permission Managing Page.

ADFS 2.0 Sharepoint Event ID 364 error

I'm attempting to configure a Sharepoint server to communicate with ADFS for authentication. I am following the instructions found here: https://technet.microsoft.com/en-us/library/hh305235(v=office15).aspx
When I attempt to open the web page, I recieve an ADFS error. It shows up as an Event ID 364 and gives the following log.
Encountered error during federation passive request.
Additional Data
Exception details:
System.Web.HttpException: Error executing child request for handler 'ASP.homerealmdiscovery_aspx'. ---> System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
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.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.homerealmdiscovery_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
--- End of inner exception stack trace ---
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(IHttpHandler handler, Boolean preserveForm)
at Microsoft.IdentityServer.Web.PassiveContext.TransferToASPX(HttpContext context, String path, Boolean preserveViewState)
at Microsoft.IdentityServer.Web.Dispatchers.ClaimsProviderUserInterfaceDispatcher.DispatchInternal(SignInContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolHandler.ProcessRequestInternal(PassiveContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolHandler.ProcessRequest(HttpContext context)
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
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.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.homerealmdiscovery_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
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.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Can someone help?
Few things you can check:
The Identifier claim for the logged in user is not blank in active directory. For e.g. during configuration PS commands if you set EmailAddress to be the identifier claim, then all users logging in to Sharepoint must have Email adrress associated with them
Logon token expiration should not be 0. Check this at your ADFS server. Below command can be used to Set token lifetime
`Set-AdfsRelyingPartyTrust -TargetName “SharePoint 2013” -TokenLifetime 30`

Error in asp:Chart control

I am using a Chart control in my website. the code and chart control is working perfectly on my local machine. But when i am deploying it on web server its giving error. I have also change version of my site to 4.0 and given all the tab and references in web.config
The Error is
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.DirectoryNotFoundException: Invalid temp directory in chart handler configuration [c:\TempImageFiles]. at System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() at System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(String parameters) at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeParameters() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) at System.Web.UI.DataVisualization.Charting.Chart.GetImageStorageMode() at System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() at System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.reports_rptresultchart_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\466f50e4\198c9161\App_Web_jolxexts.2.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Here, I cannot find exactly why the directory error is giving for directory c:\TempImageFiles as i havent used anywhere in my entire code for this path.
Please can any one help me on this.
Add the following entry to the appsettings section of your web config.
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
If there is already an entry there then replace it with this one.
EDIT
Instead you could supply a path to your folder
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=PathToYourDirectory;"/>
Alternatively there is an article here that should give you lots of things to try.

Resources