I've recently updated my ASP.NET project to .NET 4.5 (from 3.5) . This led to ClientSideEvents not firing properly on my Infragistics UltraWebGrid.
The problem is that in my .aspx file I have configured a client side event on the UltraWebGrid like this:
<ClientSideEvents ClickCellButtonHandler="webGridSoftwareConfigurations_CellClickHandler" />
And in a js-file I have the following:
function webGridSoftwareConfigurations_CellClickHandler(gridName, cellId) {
// Do some stuff
}
Previously, when I clicked in a cell, the javascript function was triggered. But now after the update to .NET 4.5, nothing happens. I'm using Infragistics2, Infragistics.Web.dll with version 11.1.20111.2112
I think the root of my problems were actually caused by the fact that ASP.NET 4.x changes how the controls ids are generated. Before, the ids were prefixed with ctl00 and the older Infragistics NetAdvantage controls seem to be dependent of this.
My solution was to:
First, update Infragistics NetAdvantage to a more recent version (NetAdvantage 2011). There are newer version but this one still supports .NET 3.5, and I need this since I can't update all my projects that use Infragistics NetAdvantage to .NET 4.5
And then update the web.config so that we use the old way of naming controls:
<configuration>
<system.web>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" >
Thanks to this answer, and this blog post by Scott Gu.
Related
I i've upgraded winforms from .net framework to .net 6 without compile issues an builds and runs however as the UI is slightly larger. This makes most of the app out of order in terms of size (things are getting cut off or not appearing as they are off the control etc).
i've checked the designers for both controls and the size values are the same between the framework version and .net 6 version
is there some setting in the project files which was shrinking control UI in .net framework?
an example this is the .net framwork version
and this is the .net 6 version
below is what it looks like at run time, the .net6 being in red and .netframework version being in blue
Adding this line seems to have resolved the issue in the startup / program.cs class https://www.codeguru.com/csharp/windows-forms-gets-font-changes-designers-and-more-in-net-6-0/
[STAThread]
public static void Main(string[] args)
{
.....
Application.SetDefaultFont(new Font(new FontFamily("Microsoft Sans Serif"), 8f));
......
}
Try replacing all instances of AutoScaleBaseSize with AutoScaleDimensions using a solution-wide replace. This seems to fix the problem for us when using the new WinForms designer.
UndeadEmo's answer was also helpful but seems to only correct the issue at runtime.
See also: https://github.com/dotnet/winforms/issues/1827#issuecomment-529831732
Can anybody get ASP.NET Dynamic Data Entities Web project working under EF 6.0.2 and .NET 4.5 in Visual Studio 2013?
I find problems in ManyToMany_Edit.ascx.cs and Global.asax.cs all relating to the switch in namespace for ObjectContext. Changing the using statements in the generated files is not enough. In other words, following this guide is not enough.
System.Web.DynamicData.dll doesn't seem to be aware of System.Data.Entity.Core.Objects.ObjectContext.
Have you read this post? http://blogs.msdn.com/b/webdev/archive/2014/02/28/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx , this works for me
I am converting a active profile STS to the new .NET 4.5 System.IdentityModel framework. My code using the UserNameWSTrustBinding which doesn't seem to exist in the new framework. Any suggestions.
Although this is an old question, I couldn't find any non-third-party answer on the internet, so here it is:
To replace UserNameWSTrustBinding in .NET 4.5, use the following:
var binding = new WS2007HttpBinding(SecurityMode.{what it was before});
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
I ported the WCF bindings to thinktecture identity model:
https://github.com/thinktecture/Thinktecture.IdentityModel.45
I also had a hard time finding something that for .NET 4.5 that was not a third party library. But I came across this link for code you can include in your project.
I try to below link for window application with MEF
http://geekswithblogs.net/malisancube/archive/2009/05/26/managed-extensibility-framework-101---a.aspx
it's work good in Framework 3.5 but when i try to develop same code for framework 4.0
not able to find below function
return container.GetExportedObject<Form1>();
please give me some properly example for window application with MEF where my container all the Usercontrols on Form
MEF was being developed pre-.NET 4.0 but it became an official part of the framework from .NET 4.0 forwards. The API you are looking for is actually the ExportProvider.GetExportedValue<T> method which CompositionContainer inherits from:
return container.GetExportedValue<Form1>();
GetExportedObject was renamed GetExportedValue, and it occurred with MEF preview 6, which means that blog post was actually based on quite an early revision of MEF.
I recently migrating my ASP.Net MVC 1 application from VS.Net 2008 / C# 3.5 to VS.NET 2010 / C# 4.0.
I massively used a builder to get URL strings from the strongly typed calls.
It looks like this :
// sample call :
string toSamplePage = Url.To<SampleController>(c => c.Page(parameter1, parameter2));
the code is added as an extension to the default UrlHelper :
public static string To<Tcontroller>(UrlHelper helper, Expression<Action<Tcontroller>> action) where Tcontroller : Controller
{
// based on Microsoft.Web.Mvc.dll LinkBuilder
return LinkBuilder.BuildUrlFromExpression<Tcontroller>(helper.RequestContext, helper.RouteCollection, action);
}
The only problem of this, is the reference to Microsoft.Web.Mvc dll, but the gain in readability was worth it.
Problem : it does not work anymore, return (null) whatever the parameters.
Questions :
is there a better way now to build links from an expression ?
(yes I tried to google it without success)
is there a trick to have the former LinkBuilder.BuildUrlFromExpression works ?
I tried to recompile it into C# 4.0, but the problem is that it implies working on my own compilated version of System.Web.Mvc which is not an option.
I'm currently trying to migrate to MVC 2 but I still have issues...
Waiting for your suggestions...
Our team overcame this identical issue by referencing System(Microsoft).Web.Mvc 2.0.0.0 statically in our libraries folder, as opposed to a GAC reference. This permitted us to continue working with MVC 1.0.0.0 projects and also gave us the downstream benefit of not having to install MVC 2 on our servers.
Oki, I found the problem.
I had assemblies versioning problems.
After rebuilding Microsoft.Web.Mvc + unistalling MVC 1 + refreshing all references it finally worked again.
It sucks because I still need MVC 1 for others projects, but at least my main problem has been solved.
To developpers new to the MVC framework : consider starting directly with MVC 2 / VS.Net 2010 / C# 4.0