.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Very slow repainting when moving or resizing an usercontrol in VS2008

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework

After migrating a WinForm application with usercontrols that loads dynamically from VS2003 to VS2008 the usercontrols became extremly slowly when moving or resizing.

Gratefull for help and tips

View Complete Post

More Related Resource Links

Issue with dynamic usercontrol loading when using ParseControl() method in VS2008


In the process of migrating an old VS2003 web app to VS2008, I'm running into this issue and haven't been able to find a resolution. 

Sample code:

"Default.aspx" has a PlaceHolder(ToolHeader).  In the Page_Load(), we dynamically load a user control passing in the virtual path to a helper method [public Control ParseUserControl(string virtualPath)].  This reads the content from the physical path, returns a Control from ParseControl() method. 

 I immediately get the following error when I open the default.aspx page in browser.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'DynamicUC.UcControl'.

Source Error:

 Line 1:  <%@ Control AutoEventWireup="true" CodeBehind="UcControl.ascx.cs" Inherits="DynamicUC.UcControl"  %>

Can't figure out why it can't load the type.  Namespaces are looking right.   I try removing the Inherits="DynamicUC.UcControl" attribut

Resizing the Border Element or a UserControl !?


Hello everyone,


I have created a user control (to replicate the tool box in .NET IDE), which I want to be able to re size with mouse. As you know user controls do not have borders so I did this:


            this.border = new Border();
            this.border.Child = this.scrollViewer;
            this.border.BorderThickness = new Thickness(2);
            this.border.Background = Brushes.White;
            this.border.BorderBrush = Brushes.DodgerBlue;

            this.elementhost.Child = this.border;


where scrollViewer contains a stack panel, which Croatians shapes I can drag to my drawing area.


Now I am trying to capture the mouse events on border so that I can change the width and height something like this:

this.Width = (int)e.GetPosition(this.border).X;

But its not working to be precise..

I thought of binding the border to the the scroll viewer or the usercontrol (width and height property) but just not getting there..



VS2008 Workflow Designer is Very Slow

Yes, I realise that this is a known issue. And has been known since VS2005.

We, too, are experiencing very slow response in the WF designer, running VS2008. It happens on both XP and Vista. (We are using grunty computers, running Subversion, with a local repository, and ReSharper.)

Will increasing CPU power or RAM or HD speed have any impact?

While this has been acknowledged by Microsoft as a "known problem" it would help immensely if someone from Microsoft could say that it is under investigation and that one or more people have been assigned the job of sorting it out for a later (unspecified) release.

Otherwise the advantages of a DSL are outweighed by the pain during development, and what appears to be a good choice of tool may have to be put aside for an alternative approach that is more productive.

Any answers?

Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

crystal reports on mvc 2 vs2008


hi, i'm a new user of mvc 2, so, i need to use crystal reports on mvc 2, actually, i'm developing on visual studio 2008, but i can´t run my reports. it's posible run my reports???

thank you very much.

How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

VS 2010 Pro is slow



I was wondering if anybody else is finding VS 2010 extremely slow loading a solution - and it pretty much renders the rest of the machine useless until loaded. Everything is slowed to a halt.

I upgraded from VS 2005 - now I think I made a terrible mistake. I cannot afford to try and load 2 solutions simultaneously.

The machine is a Core2 Duo E8400, 3GB of RAM, WinXP SP3. Max I can go to is 4GB. Would upgrading to a 64-bit OS really be worth it (actually only to get 8GB of RAM)?

I'm hoping someone else has found a solution to this particular problem.



OutOfMemory when resizing image


I've been pulling my hair out on this one. I have a image gallery module in asp.net. I'm using Telerik RadUpload to upload a sinlge image. I then save the image on the server and create a thumbnail and save it as well. There is no loop involved and is one at a time. It always seems to work when I run it locally on Windows 7 (IIS7) but on the server IIS6 I keep getting OutOfMemory errors. The images I'm trying are barely 1MB so not huge files. I've gone through google and bing over past several days and can't seem to find a solution. In my resize methods I'm using the "using" statement on the image reference, etc. I can pretty much always make it fail with the 3rd line below:

ruPhoto.UploadedFiles[0].SaveAs(Server.MapPath("~/DesktopModules/Gallery2/Photos/" + newPhotoName));
System.Drawing.Image photo = System.Drawing.Bitmap.FromFile(Server.MapPath("~/DesktopModules/Gallery2/Photos/" + newPhotoName));
//System.Drawing.Image img = new System.Drawing.Bitmap(photo); <--- will cause outofmemory error

if I just use the photo variable then the OutOfMemory will occur later in the resize code.

Any help would be greatly appreciated.

web deployment project (WS_deploy) on VS2008


I am building a asp.net webservice in VS2008 and the web service compiles and debug fine. The project should be using : Net 3,5

 I have

  1. VS2005 and VS208 installed
  2. .Net 1.1 - 3.5
  3. WebDeploymentSetup for VS2008 (and most likely a version for VS2005 as well)

But when I add a web deployment project the fun stops. The .WS_deploy project will not compile and I cannot find any precompiled output.

--------------debug output-------------------

------ Build started: Project: **************.DAL, Configuration: Debug Any CPU ------
Build started 13-08-2010 08:17:14.
Target EntityDeploy:
    Processing 0 EDMX files.
    Finished processing 0 EDMX files.
Target CoreResGen:
    No resources are out of date with respect to their source files. Skipping resource generation.
Target CopyFilesToOutputDirectory:
    **************.DAL -> C:\Development\VS2008\**************\**************.DAL\bin\Debug\**************.DAL.dll

Build succeeded.

Time Elapsed 00:00:00.14
------ Build started: Project: **************.BLL, Configuration: Debug Any CPU ------
Build started 13-08-2010 08:17:14.
Target EntityDeploy:
    Processing 0 EDMX files.
    Finished processing 0 EDMX files.
Target ResolveProjectReferences:
Target CoreResGen:
    No resources are out of

Cutting Edge: Moving DataGrid Rows Up and Down


Imagine opening your Inbox one morning and finding a message that reads "Dear Mr. DataGrid, I urgently need an ASP.NET DataGrid that lets my users move rows on the client. You're my last hope. Will you please help me?"

Dino Esposito

MSDN Magazine March 2005

UserControl like asp:Panel


Is it possible to write own User Control with functionality like asp:Panel?

Do not see the table in Database after moving the project folder



I created a ASP.NET project under Visual Web Developer 2008. Under that project I had a Database (along with ASPNETDB.MDF) which has about 3/4 tables (I had SQL server 2008). Everything was working fine (like insert, delete, etc.). And I was able to view the tables in database explorer view.

Then I had to format my computer for some reason and I copied the whole project in a USB drive and then after formatting the computer I copied the folder and tried to open it in Visual Web Developer (now I have VWD 2010). I can see the both Database under App_Data folder (ASPNETDB.mdf and the DB I created). ASPNETDB has all the tables and data as expected. But I do not see the tables under the DB I created.

I also tried in one of my friends computer who has Visual Web Developer 2008. But same result.

I am just wondering if anyone can help me with retreiving the table. I have a bad feeling that I might needed to do something to backup the data (not sure though). But the tables should be still there ... isn't it ?

Any help will be appreciated. Thank you in advance.

Moving a website - URL aliasing question


Hi we are migrating a website from a proprietary system  to a new system built inSQL 2008.

The old  system has about 6,000 pieces of content with individual hard-coded aliases. How could we go about creating a match table to ensure these resolve with our new system (based on Intellgentsia URL rewriter)?

Any pointers would be helpful.

Live website slow - very urgent


Hi All, 

Finally i came to know because of firebug that  ScriptResource.axd's (multiple) are making my files slow on first click

How do i merge them into 1 ??



1. ScriptResource.axd is making my page slow in first click.

On second click onwards its fine as i have added handler from http://madskristensen.net/post/Compress-WebResourceaxd-in-ASPNET.aspx   It helps performance but from second click onwards.I am testing it with FireBug.

2. I have also seen and treid http://www.codeproject.com/KB/aspnet/AspNetOptimizer.aspx  but not able to make out how to implement in my application.

3. I also tried http://madskristensen.net/post/Optimize-WebResourceaxd-and-ScriptResourceaxd.aspx but it has error, I tried making chnage as per the discussion in url but it is sill giving error.

4. I have also made scriptmanager as release mode

Please help its urgent


Problems moving an InfoPath form from a DEV system to QA environment


We developed an InfoPath form using a local DEV environment.  The site collection under which the form was developed was http://server1/.

We are now attempting to deploy this form to a TEST environment that uses a slightly different structure for the collection, namely http://server2/sites/sitecol1.

In both cases the site that contains the form is /fin (so we were using http://server1/fin in DEV and want to use http://server2/sites/sitecol1/fin in TEST). 

The form contains VBA code and so requires admin-based deployment via Central Administration, so to deploy to TEST we:

1. Publish the form against the TEST server using InfoPath Designer

2. Upload the form using Central Administration > Application Managment > Manage Form Templates

3. After upload, we activate the form for the site collection http://server2/sites/sitecol1/

4. The form is then associated with a Form Library

When we try to create an instance of the form within this library we get the following error when we click on New to create the form instance:

The following location is not accessible, because it is in a differ

Slow page load during a list query one time during the day


We have a monitoring tool set to check to see if the home pages for our 3 web apps load in under 60 seconds every 10 minutes.  All 3 web apps load in under 3 seconds on every 10 minute check except for one exception.  One check every day one of the web app's home page takes longer than 60 seconds to load.  This happens at 11:45PM when there is very little user usage on the environment.  The characteristics of this page are as follows: The only thing on the page is a list view web part which was added by the browser.  The page has not been customized with SPD or code at all.  The list that it pulls is a simple links list that has 281 items on it.  The view pulls all 281 items and displays them in sets of 100.  I cannot find any associated event in the server events and/or SharePoint ULS logs nor are there any daily sharepoint timer jobs running at that time.  Our full index happens at midnight with incremental happening hourly.  Our enviroment is 2 WFEs, 1 App/indexer and we have a separate SQL cluster backend.  

Could someone lead me possibly in the direction I should take next in my troubleshooting?   

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend