MissingManifestResourceException runtime - asp.net

Any suggestions on the following error:
"Could not find any resources appropriate for the specified culture or the
neutral culture. Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources"
was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time,
or that all the satellite assemblies required are loadable and fully signed."
I added ajax control toolkit to my project....

Make sure you have: ScriptManager on your .aspx page.
Note: There is one special requirement when using the controls from the AJAX Control Toolkit. The page must contain a ScriptManager control. The ScriptManager control is responsible for including all of the necessary JavaScript required by the AJAX Control Toolkit controls.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

Related

Confused why JavaScript Bundling breaks in Web Forms ASP.NET 4.5

I'm working on an application where a previous developer loaded the same script file across many different pages.
<script src="../scripts/helpers.js"></script>
Now I'm trying to load that into the BundleConfig.cs file so it's accessible throughout the site and not referenced on every page. I also have BundleTable.EnableOptimizations = true;
bundles.Add(new ScriptBundle("~/bundles/helpers")
.Include("~/scripts/helpers.js"));
In the Site.Master I'm referencing it (currently in the head, but have tried several places in the body as well) as:
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/helpers") %>
</asp:PlaceHolder>
When I look at the network tab in the Chrome console, it shows that it bundled the file, but none of the functionality is working. I can't seem to figure out why it's working when called on every page, but not when it's bundled once and always there. This is the first time I've worked on a .NET app, so I have definitely been scratching my head on this one.
Not sure why it works this way, mostly because I'm not familiar with ASP.NET. But referencing it in the script manager made it work.
<asp:ScriptManager runat="server" EnablePageMethods="true" >
<Scripts>
<asp:ScriptReference Path="~/bundles/helpers" />
</Scripts>
</asp:ScriptManager>

How to Combine Scripts using Telerik ASP.NET with AJAX Control Toolkit

I am working on a corporate website where the AJAX Controls are being used in tandem with Telerik ASP.NET Controls. While this poses no real issue in terms of functionality, there is a problem with overall performance.
In order to prevent the AJAX toolkit script manager from making multiple calls for all scripts on every component it supports, we set the CombineScripts flag to true, set the EnablePartialRendering flag to true and specify a URL for the CombineScriptsHandlerUrl.
This works great as the generated Scripts for the AJAX Components are significantly decreased as well as corresponding roundtrips. However, we've found that the Telerik Controls have issues with this setting. More specifically for this particular site (the TelerikHTMLChart Control)
After further research, it was affirmed that the CombineScripts flag has to be set to false in order for the Telerik controls to work with the AJAX controls in this capacity.
Obviously this is not the most ideal option when you're targeting to increase the sites overall response time.
Has anyone having this issue been able to acquire a reasonable solution for the problem that would allow the AJAX and Telerik ASP.NET components to play happily together without performance degradation?
Thank you for the response rdmptn, but while in the process of waiting for someone to respond with an appropriate and acceptable resolution; I managed to figure out the solution to the issue. So I am posting this for others who may also have the concerns for performance and require a viable solution to the problem.
Rdmptn has already done a very fine job proposing workarounds this problem. In fact, the cause of the problem is in fact as has already been stated. However, there is another way to have the AJAX ToolkitScriptManager implemented with the CombineScripts flag set to true to alleviate excessive roundtrips and also use the Telerik Controls in a performance efficient manner. I had to experiment a bit in effort of finding this solution so maybe this will help others. The Telerik support staff was unable to provide this solution, so I am also giving it to them.
First, you have to identify the required Telerik Script references required for your particular scenario. You may acquire this from the following link: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html
Then find the Telerik control(s) you need on your site. You will note that the options provided in this link restate the 3rd bullet point provided by rdmptn. However, the method I am describing does not require any modification to the web.config nor does it use CDN references. Our decision to opt out of CDN references is to avoid further potential performance degradation by reliance on other sites.
Once you've identified the control(s) you require, copy and paste the ScriptReferences from the link provided into a tag within the AJAX ToolkitScript Manager. In my case, the resulting code would look like this:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" ScriptMode="Release" runat="server" EnablePartialRendering="true"
CombineScripts="true" CombineScriptsHandlerUrl="~/AjaxScriptMergeHandler.ashx">
<CompositeScript>
<Scripts>
<asp:ScriptReference Path="~/Scripts/Common/Core.js" />
<asp:ScriptReference Path="~/Scripts/Common/jQuery.js" />
<asp:ScriptReference Path="~/Scripts/Common/jQueryPlugins.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/html5/core.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/html5/dataviz/core.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/Data/html5/data.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/html5/userevents.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/DataViz/html5/dataviz/themes.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/DataViz/html5/dataviz/chart.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/DataViz/html5/dataviz/svg.js" />
<asp:ScriptReference Path="~/Scripts/Common/HTML5UI/DataViz/html5/dataviz/vml.js" />
<asp:ScriptReference Path="~/Scripts/HtmlChart/RadHtmlChart.js" />
</Scripts>
</CompositeScript>
</ajaxToolkit:ToolkitScriptManager>
This approach allows the AJAX ToolScriptManager to explicitly minimize the number of Scripts required to support the components you actually use in your site (or webpage) having the CombineScripts tag set to true while simultaneously loading only those Scripts that are required within your application to be loaded for the Telerik controls.
No more being set to false as has been the often response for the noted incompatibility issues; while at the same time loading only the required Scripts to support your Telerik controls. VOILA!
Hope this information helps others and saves them the time we've wasted to get a resolution.
Again, thank you rdmptn for posting your suggestions!
I am not aware of a way to do that. AjaxControlToolkit broke compatibility with <asp:ScriptManager>. Telerik controls are built over the vanilla MS AJAX framework, so there is no compatibility between the two suites due to the AjaxControlToolkit changes in the winter of 2013.
Thus, ideas to consider are:
remove the AjaxControlToolkit controls in favor of the Telerik controls
live with more requests than you would like to
try downloading the combined script for the Telerik controls from their CDN and referencing that in your page, then disabling the embedded scripts for them. You can enable it by using RadSCriptManager, enabling its CDN and setting the Telerik.ScriptManager.TelerikCdn.CombinedScript appSettings key to true in the web.config
if you only need the HtmlChart from Telerik, try the Kendo Chart widget. They are both the same, but the Kendo widged is pure client-side code and is not related to MS AJAX, AjaxControlToolkit or the UI for ASP.NET AJAX suite

Use Ajax ToolKitScriptManager along with ScriptManager

I have a page test.aspx which is inheriting master page.The master page has script manager addeded to it.I am trying to add the rating control availabel in the ajax control toolkit.
So i need to add the line <Ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/>
But since the script manager is already availabel in master page i cannot add this line to my test page.And if i dont add it will not function.
What should i do?
Is there difference between script manager and toolkitscriptmanager.
How to use both simultaneously?
You can replace the scriptManager in the master page with <Ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"/> .This will certainly solve your problem.
First of all: if you use ASP.NET 3.5 and controls from AJAX Control Tookit then you must use the ToolkitScriptManager, rather than the ASP.NET ScriptManager. This limitation according to the fact that toolkit script manager adds updated Ajax scripts and without that most of the controls from Ajax Control toolkit library will not work.
If you using ASP.NET 4.0 (4.5) than you have choice to use ScriptManager or ToolkitScriptManager.
Basically the main feature of the ToolkitScriptManager is that it can combine js resource added to page using ScriptReference collection. These js files should be embedded to assembly and for this Assembly ScriptCombine assembly attribute should be added. The main problem here is that you can't control how scripts are combined and after you will try to combine your own scripts you can have a lot of problems (I had experience using this feature and as a result we rejected combining of our scripts using this approach).
The main point here is that currently standard script manager has ability to combine scripts using composite script collection.

Can I publish an ASPX page and its code-behind file from Tridion?

I have developed an ASP.NET chat application. Now I want some integration with my Tridion page. To do so I need some code behind file for the published page. And one more issue suppose I want to add a button in my page with its click event. How can I achieve that?
what I've done :
<%# Page language="c#" Inherits="SDLchat.ChatWin" CodeFile="ChatWin.aspx.cs" %>
<%# Register src="ChatLogin.ascx" TagName="c2" TagPrefix="uc2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ChatWin</title>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Panel ID="Panel1" runat="server">
<uc2:c2 ID="log2" runat="server" />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Visible="False">
<asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click">Change Room</asp:LinkButton>
</asp:Panel>
</form>
</body>
</HTML>
This is my ASP.NET web app that I want to migrate in Tridion. Please help
So you have two files for every page in this application:
the ASPX file that contains the markup
the CS file that contains the code
Since Tridion publishing is based on one-file-per-page, you can get both of these files published from Tridion by creating two separate pages for them. Alternatively you can choose to just publish the ASPX from Tridion and deploy the CS file when you deploy the web application to IIS.
I'd suggest putting the ASPX contents into a DWT Template Building Block in Tridion and then using that one as the only Building Block in a Compound Page Template.
If you decide to also publish the code-behind CS file from Tridion, create a separate DWT for it, paste the code in there and create a separate Compound Page Template for it.
On your second question about a PageLoad event: Tridion will just publish the files that you put in it in this case. It has nothing to do with the ASP.NET code you put in those files. If the ASP.NET page-load event works outside of Tridion, it'll work when you publish the same files from Tridion.
Frank has made an accurate answer, but I would consider it a very bad practice to publish any code from the CMS to the Web Application. Using that approach makes it impossible to test your entire application as CMS users can incrementally update the application.
I would strongly suggest putting all your code behinds into the web application and deploying those through your typical web application deployment process offered by tools such as Visual Studio, and only publishing the ASPX files which have references to the code which is already in your web application.
I agree with Chris here, just because it is possible to publish just about anything from SDL Tridion CMS (including dlls, .config files, uncompiled code etc. etc.) doesn't mean you should.
The lifecycle of application logic (or code) is very different to the Content life cycle. Typically code changes need to be carefully deployed, tested, fixed and redeployed throughout dev, test, acceptance environments before being deployed on production by technical users in a single action. Depending on your organization you may have monthly or shorter/longer development and deployment cycles.
On the other hand, your real life content typically lives the production environment only and is updated as often as required (perhaps hourly or even more frequently) by non-technical users.
If you confuse Content Management with Application deployment you will quickly get into a mess. Imagine someone accidentally unpublishing the App_Code structure group? What if an editor republishes an entire Structure Group but didnt realize that you were halfway through making some changes to the code behind? How are you going to ensure that the dll in the bin structure group gets published at exactly the same time as the web.config and the ascx controls registered in it which are somewhere else? Best case your application might not work, worst case you get compilation errors throughout your entire site.
Some guidelines that I have seen and used on various ASP.NET/SDL Tridion sites are as follows:
Use a standard base page (or limited set of base pages, perhaps determined by page template) as a common code behind for all your published aspx pages - put generic logic in here
For any specific functionality, encapsulate this in a control (ascx or web control) and put logic in the code for this
Have the .cs for the base page, code behind for controls and other logic in a compiled dll in the bin directory - App_Code is great for development, but can create deployment headaches with all those different files to manage

'AjaxControlToolkit' is undefined Error

I am using the AjaxControlToolkit in VS2005, and it works fine. I do have some issues though, when I go to some pages I have, then click back, I get this JavaScript error:
'AjaxControlToolkit' is undefined
I have searched MSDN forums, and google, and tried many of the solutions, but none have worked. I have tried, EnablePartialRendering="true", and others. Short of rewriting everything and changing the workflow of my application, is there any way to find the root cause of this, or fix it?
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
I got this problme fixed but not by setting CombineScripts="false" but by using the solution described in this post.
There have been some changes in the latest version, due to which you have to use Sys.Extended.UI.BehaviorBase instead of AjaxControlToolkit.BehaviorBase in the registerClass call.
To get around this 'AjaxControlToolkit' is undefined Error, you may also want to ensure that you have CombineScripts set to false in your ToolkitScriptManager configuration. This can be found in your Master page and this solution has worked for me.
<myTagPrefix:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true" SupportsPartialRendering="true" **CombineScripts="false"**>
Note you will want to change myTagPrefix to the tagprefix you are using for AjaxControlToolkit. This is usually defined in asp at the top of an aspx file like this...
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="myTagPrefix" %>
This may be a silly question, but did you double check to make sure you have the toolkit reference at the top of your aspx file?
(Adding from comment for ease of reading)
Try adding this to your web.config
<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="false" enableCaching="false" />
</scripting></system.web.extensions>
Is that a javascript error?
I suppose it has to do with back-button support in the toolkit.
And undefined errors mostly occurs because somehow the script that contains "AjaxControlToolkit" doesn't gets properly loaded.
Thing that come to mind:
The order scripts get loaded, does the Toolkit gets priority?
When there are errors in any of the loaded scripts all the other scripts that hasn't loaded yet will simply be canceled and not gets loaded.
See the outputted HTML of the problem page, find links to all the AXD files and make sure you can download them and see valid javascripts inside.
And if you don't already, get Firefox and Firebug and you should be able to trace to the actual script line that emits the error.
Hope this helps.
As [CodeRot] said you need to ensure you have all the AJAX web.config extensions in place, this is the most commonly missed point when doing ASP.NET AJAX sites (particularly from VS 2005).
Next make sure that you have a ScriptManager on the page (which I'm guessing you do from the "EnablePartialRendering" mention).
Make sure that you are referencing the AjaxControlToolkit version for your .NET version, it is compiled for both .NET 2.0 and .NET 3.5, and I believe the latest release is only supporting .NET 3.5.
Ensure that you're getting the Microsoft AJAX Client Library added to the page (that you're not getting any errors about "Sys" missing).
Ensure that you a registering the AjaxControlToolkit in either your ASPX, ASCX or web.config.
If nothing still hasn't worked out for you. Verify that you are not caching this ascx/aspx. Remove the OutputCache declaration.

Resources