Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
322 views
in Technique[技术] by (71.8m points)

javascript - Why do script blocks grow endlessly in VS2010 Debugger when running ASP.Net page with partial postbacks?

On an ASP.Net page that uses an UpdatePanel containing various validated controls for partial postbacks, the Visual Studio 2010 script debugger window starts to show an ever growing list of "Script Block" entries which appear to be anonymous our auto-generated functions related to the controls on the panel as it is reloaded. It appears that old script blocks from previous times the panel was updated are not disposed so the list just keeps on growing, slowing down the page and the debugger, until IE is closed whereupon it can take a long time to delete the hundreds of blocks that have appeared.

Is this a problem with the way the page is operating or an artifact of the debugger? Comparing performance of the debugged and non-debugged page it appears to be the latter, but it would be good to know what is going on and why.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Well Well here is your answer.

First Way

http://vishaljoshi.blogspot.com/2009/06/disabling-script-debugging-with-vs-2010.html

Basically when you debug through VS2008/2010, IE8 and forward, script debugging will be enabled automatically. Which is criticized by many. However there are few workarounds.

First one is in above article which tells you to enable Silverlight debugging and tells you path for both Projects as well Websites, where to go and how to enable it.

Once you enable silverlight debugging JS debugging is turned off as both can't run side by side.

Drawback (if you really think it is ): Silverlight tools for VS need to installed

Second Way

Start the application without debugging (CTRL + F5) once app running attach debugger manually by clicking on Debug->Attach to Process.

Now for VS 2008

For VS 2008 there are several alternatives like editing registry keys and so forth.

If anyone need VS 2008 help regarding that check this out. http://blogs.msdn.com/b/greggm/archive/2009/04/06/disabling-script-debugging-in-vs-2008-ie8.aspx


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...