system.web.ui.datavisualization.Charting dll error - asp.net

Morning all,
I stumbled on this perticular nasty error where i use an asp.net chart control (v4.0)
when i drag a chart control on my page using VS2010, i see the assemblies are being made. But then again i immediatelly get some errors that say i can't use the chart control.
My web.config file contains the following code for the chart control
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add namespace="System.Web.UI.DataVisualization.Charting"/>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
My aspx.vb file contains the following import
Imports System.Web.UI.DataVisualization.Charting
However, here i already get the following error:
Namespace or type specified in the imports 'system.web.UI.dataVisualization.Charting' doesn't contain any public member or cannot be found ...
in my aspx file the first line of code has error curves
<%# Page Language="VB" MasterPageFile="MasterPage.master" AutoEventWireup="false" CodeFile="Datalogging.aspx.vb" Inherits="Datalogging" %>
Whereas the error = Type 'system.web.ui.Datavisualization.Charting.chart' is not defined.
Thanks in advance for helping me out.
Robin
EDIT:
Seemed i had some troubles with the framework versions
I rebuilded the app in v3.5 and after that i rebuilded the app again in v4.0
Conclusion, the app works again.
Thanks for those who were searching for a solution

Related

ChartImg.axd error in ASP.NET 3.5.2

I am developing a webapp in ASP.NET framework 3.5.2.
After draging the Chart Control from the toolbox to where I want it in my .aspx page, there seems to be this added at the top of the document:
<%# Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
When I run I get the error: "Error executing child request for ChartImg.axd."
I have tried adding the following into system.web in my Web.config
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
Then I get:
HTTP Error 500.23 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Most likely causes:
•This application defines configuration in the system.web/httpHandlers section.
It says that I can try to "Migrate the configuration to the system.webServer/handlers section".
How do I do this and how till it affect my webapp? Will something else stop working and is it possible to revert the migration?
With ASP.NET 3.5 projects where I got this error I went into IIS and changed the APplication Pool to run in Classic Managed Pipeline Mode rather than Integrated
To change this go to :IIS, go to Application Pools, Find the pool you're using and change it to Classic.

Could not load file or assembly DevExpress version 11.1 in asp.net(vb)

I am working on project which is build on 2.0 framework of .net
We were using devExpress version 7 before but the some controls of devExpress 7 doesn't supports modern browsers. So i installed and included devExpress version 11 assemblies.
I copy/pasted assembly files of version 2011 into Bin folder of my project.
I added reference in web.config file
In web.config, I have now
<add assembly="DevExpress.Data.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/></assemblies>
In my asp file i have :
<%# Register Assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<%# Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%# Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%# Register Assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dxtc" %>
Well i dont know about Culture=neutral, PublicKeyToken=9b171c9fd64da1d1" I just copy/pasted it from previous assemblies register tag
When i run my project, I am getting following error :
Could not load file or assembly 'DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Please assist me on this and tell me why the system is not able to find assembly files.
Thanks..
Anjum
The assembly's public key token is another for 11.1. So, to resolve this problem you need to either remove this information from your source code or update it to the correct value. I suggest that you use project converter to upgrade your project to this version. Usually, it is located in "{DevExpress folder}\Components\Tools\DXperience\" folder.
I used project converter to convert my project from devExpress 7 to 11 and it works fine.
Project converter comes with installation package of devExpress 11.
I hope this will help others facing with same issues.
Thanks..
Anjum

ajax got error on hosting the webpage

My Website is working fine locally but got problem in making live.
Parser Error Message: Unknown server tag 'asp:ScriptManager'.
I googled this problem and find solution as...
<pages>
<controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls> </pages>
I did same but got error again.....
Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have uploaded ajaxtoolkit in Bin folder???? Please help me out...
Most likely you haven't configure the right .net version. Check with your webhosting company or control panel to see what .net version your site is using. You can also try smarterasp.net, they let you set your own version via their control panel too.

how to upgrade code to a new version of third party control

I have a web application in asp.net 3.5 where i have been using some third party controls i.e. Devexpresv9.2
and on the pages where i am using these controls i normally has to call the register tag on the page markup like for ex:
<%# Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%# Register Assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
Now i have updated the version of devexpress controls installed on my machine and it has stopped working because the version installed on my machine is v10.0 but my code is looking for v9.2
Please advise how can i modify my code in such a way that in future if i install another version then i don't have to modify all the pages and references again. May be something in web.config that can help me or anything generic??
Thanks
Use the project converter which is designed for this. It is located under the Windows Start Menu at "Develper Express V2010 vol1 -> Components -> Tools -> Project Converter". This will automatically change all of your references to the current version.
Project Converter Documentation
I think you answered your own question. You don't need to add the assembly reference on each page, put it in web.config.
<system.web>
<compilation>
<assemblies>
<add assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a">
<add assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a">
</assemblies>
</compilation>
<pages>
<controls>
<add namespace="DevExpress.Web.ASPxCallback" assembly="DevExpress.Web.v9.2" tagprefix="dxcb">
<add namespace="DevExpress.Web.ASPxGridView.Export" assembly="DevExpress.Web.ASPxGridView.v9.2.Export" tagprefix="dxwgv">
</controls>
</pages>
</system.web>

Asp.Net MVC - Problem returning a model to the view

I've recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view.
Controller:
public ActionResult ForgotPassword()
{
return View(new PasswordViewModel());
}
View:
<%# Import Namespace="Portal.Site.Areas.Logon.ViewModel"%>
<%# Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PasswordViewModel>" %>
Nothing to difficult here, except i consistently get the following error.
Parser Error Message: Could not load type 'System.Web.Mvc.ViewPage<PasswordViewModel>'.
This seems to happen to any view/controller within the areas section. If I remove the return model and add use the Dictionary, it works fine.
Now I am aware of issues regarding this, as the thread describes.
http://forums.asp.net/t/1378448.aspx
I would be interested to see if anyone thinks this is areas related? (Although in a clean basic project this works). Any suggestions on solutions? Is this a bug?
This can be caused by not having a web.config in your views folder.
Example web.config pages settings:
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=************"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=************">
<controls>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
The problem might also be that it can't find the class PasswordViewModel because of a namespace difference. If you are using the default MVC project setup and the PasswordViewModel is in the Model folder, I believe the class name referenced in the page header should be web.model.PasswordViewModel.

Resources