May 6, 2010

Blog Archives

Another Error Creating Control in the Design View with Object Reference Not Set in Visual Studio 2010

In a previous blog, Controls State: "Error Creating Control" in the Design View in Visual Studio 2010 , I have discussed about an Error Creating Control issue related to accessing the Session state in the OnInit() method. Since then, I have discovered that the Error Creating Control will also show in the design view if we try to access any object not being instantiated at the design time inside the OnInit() method. For example, in a web application project, in a code-behind file that is adding controls dynamically to a page, similar to what was discussed in the article How To Dynamically Add Controls to a Web Page , we have code that’s accessing an object that is null at the design time as shown below When you switch to the design…(read more)

0

Design View Performance Improvements

Hi, I’m Dan Chartier, I work on the Web Tools designer and helped improve its performance in Visual Studio 2010. For some background, Visual Studio 2008 completely replaced the original trident (Internet Explorer) designer with the FrontPage designer (which is also used by Expression Web). While we gained many improvements with this change, we received customer complaints about various performance problems that we wanted to address in 2010. In general, the designer is quite fast. This is especially true when editing pure HTML documents, which is what it was originally designed to do well. However, the designer edits more than HTML. It also has the rather sophisticated ability to edit ASP.Net pages containing various interesting web controls…(read more)

0

Upgrade or Uninstall of Office 2007 might cause VS 2008 Web designer to hang

With Office 2010 releasing, some of you might be upgrading to Office 2010 from Office 2007. A plain uninstall of Office 2007 might also run into the issue described below. If this is something you have done (or plan to do) and are running a 64-bit OS, please keep on reading. On machines with a 64-bit OS, uninstall of Office 2007 will break the VS 2008 web designer. You will find that the VS designer won't be able to load, and any attempts to switch to Design View will hang the product. Note that 32-bit machines are not affected and neither are other VS releases. The root cause of this problem is that Office 2007 and the VS 2008 web designer both share a component, 32-bit MSXML5. When Office 2007 uninstalls or gets upgraded, MSXML5 is removed…(read more)

0

Rendering Issue in Visual Studio 2010 when Accessing the Session State in the OnInit() Method

In VS 2010, if you are accessing the Session state in the OnInit(…) method of your page, similar to the following code snippet: then you will encounter an “Error Creating Control” for ASP.NET controls when viewing the Design view of the page. For example, if you have an ASP.NET button control on the page, the designer will display the error: “ Error Creating Control – Button1 Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System. Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.”. Screen shot of the error: However…(read more)

0

Workaround: Missing Declarations for Controls in Designer File

We have seen some customers report the issue that certain controls are not getting generated correctly in the designer file in Visual Studio 2010 RC for the ASP.Net Web Application Projects. We are currently working on a fix for this issue for the final RTM release. Workaround: You can work-around this issue by declaring the missing controls in the code behind file for the ASPX page. Example: When you add a Button control with ID as “Button1” to the aspx page normally you should see the following code be generated in the designer file for this control. VB: Protected WithEvents Button1 As Global.System.Web.UI.WebControls.Button C#: protected global::System.Web.UI.WebControls.Button Button1; If this code is not being generated in the designer…(read more)

0

About

ASP Experts...All the latest news related to asp.net and web development in one location. We do the work for you so you don't have to :)