Web Development Helper and ASP.NET Ajax

A brief intro on an update to the HTTP tracing feature in Web Development Helper to enhance the display of async post-back/partial rendering responses sent by the server when using the UpdatePanel server control.

Its been a long while since I last updated my Web Development Helper tool. I just published v0.8.4.0 on my projects site. First it has an installer, which should take care of most of the install problems people have had in the past, but should also allow it to work on Vista.

The main update for this release is the enhancement to HTTP tracing feature which now provides multiple types of response viewers. The response viewer feature is available when you double click on a logged HTTP request to view its details. In the past, the only option you had was to view the response as raw text or hex (if the response contained binary data). With the latest build you now get different viewers depending on the request and response. In particular there are three new views to check out: Image, JSON and Partial Rendering. The latter two should help folks doing AJAX development.

First the Partial Rendering response viewer. For a quick and brief description of the scenario, when you use ASP.NET AJAX and UpdatePanel server controls, the normal browser postbacks are suppressed, and instead the client makes the same requests to the server using XMLHttp instead. The client identifies these special requests with a request header (x-microsoftajax with a value Delta=true). The server responds with what we call a “delta” response. Essentially rather than sending down the entire page, it sends the markup for updated parts of the page along with some metadata. The Partial Rendering response viewer is activated when the special header I just mentioned is detected. Once activated, the viewer parses the delta response and provides a more structured view, as shown in the screenshot. Thanks to Eilon Lipton, a developer on the ASP.NET team responsible for a number of the features in ASP.NET Ajax, who put together the implementation, and btw, just started blogging.

The other viewer that is interesting is the JSON viewer. A lot of data interchange that happens via XMLHttp is often JSON, i.e. the response has a content type of “text/json” or maybe “application/json”. This is certainly the case if you're using Web services with ASP.NET AJAX. The screenshot below shows a simple JSON object in the viewer that is activated by the content type of the response. You can imagine more complex JSON object graphs being easier to view in this type of viewer rather than as raw text.

Finally, I've uploaded some documentation that describes all the features with short blurbs about using them, and screenshots as well. It also includes a description about the updates to provide even more flexibility around choosing what to log and what not to log when it comes to HTTP tracing. Check it out.

There are a few more features I am planning to add on the short term in terms of integration with ASP.NET AJAX. Examples:

  • The notion of request viewers, so you can better visualize things like JSON formatted request bodies that happens with Web services.
  • Picking up view state updates after async postbacks (currently only the view state sent in the initial request is viewable).
  • A mini-classbrowser that allows you to browse the set of classes defined in script loaded into the page.

So stay tuned... as always feel free to send comments either down here, or via my projects site.


[ Tags: | | ]
Posted on Monday, 11/13/2006 @ 4:24 PM | #Projects


Comments

38 comments have been posted.

Rail Sabirov

Posted on 11/14/2006 @ 12:04 AM
Nikhil, i found a bag: NullReferenceException
stack trace:
System.NullReferenceException: Object reference not set to an instance of an object.
at nStuff.WebDevHelper.UserInterface.HttpTools.JsonResponseViewer.CanViewLogItem(HttpLogItem item)
at nStuff.WebDevHelper.UserInterface.HttpTools.HttpLogForm.UpdateForm()
at nStuff.WebDevHelper.UserInterface.HttpTools.HttpLogForm.OnNextButtonClick(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

there are many htpp requests lines in my http loging window (scroller present).
i select first and click "show details...".
and click "next" button few times.
when current (selected) become not visible, next click on "next" button throw exception.

Jepper

Posted on 11/14/2006 @ 1:11 AM
Supernews Nikhil - a most appriciated effort!
Best regards

Adnan Masood

Posted on 11/14/2006 @ 5:39 AM
Excellent effort Nikhil, web dev helper is a life saver. I was wondering if you are planning to add performance statistics (like fiddler) in any future versions?

Chyld

Posted on 11/14/2006 @ 7:57 AM
Very nice! Keep up the great work!

Alex Osipov

Posted on 11/14/2006 @ 8:07 AM
Nikhil - great work, great update. A few comments.

JSON viewer is great, very useful.
1. One thing I would love to be able to do is copy the tree as plain text with appropriate spacing or even print.
2. Visual change I'd like to see is the key and value to be differentiated.

DOM Inspector - I would like to see features converge with IE development toolbar (which hasn't been updated in a while!!!). Specifically I'd like to see:
1. Find element by click
2. Option for color to highlight DOM element in page.
3. Column headers in Attributes, Styles, etc to be sortable (asc, desc, not empty). So empty rows can be on the bottom and ones that matter on top.
4. Dynamic editing of styles, attributes as with IE dev toolbar.
5. Ruler!
6. Some form of copy feature in trees and tables (in addition to dynamic editing of styles, etc). This would be great as a lot of the times to get an interface just right I will edit styles with IE dev toolbar and then apply those changes to my code. Would be great if I didn't have to go back and forth between browser and editor and can copy the dynamic CSS changes. I think a lot of people use this type of scenario.

HTTP Logging
1. Would like to see a delta time column, rather than 2 connection time and response time (which for some reason is always same for me).
2. Timestamp would like to see date removed if it's today's date.
3. Column for response type (JSON/Image/HTML/etc).
4. A great feature would be to be able to delay responses and allow us to edit the values of the response dynamically and then proceed. For example, I would go into JSON viewer, dynamically change a value, and send it too to the browser. Of course time out would have to be considered in my application but that wouldn't be a problem.

Some problems:
1. application/x-javascript content type should show as text (in addition to text/javascript), right now it is only shown as HEX.
2. "LastModified":new Date(1163516112340) JSON leads to Error parsing JSON response. Invalid null literal.
3. When selecting a SCRIPT element inside the body, elements after the SCRIPT tag are hidden.

That's my 2 cents for now. Keep up the great work.

AO

Nikhil Kothari

Posted on 11/14/2006 @ 8:57 AM
Rail: I will try to repro later today, and if I see it, I'll try to get a fix as soon as possible.

Alex, thanks for the suggestions. Generally agree on all, though I can't promise when these type of improvements will show up.

The one on new Date(...) - that isn't "valid" JSON if you adhere to the definition of data-only JSON without any actual javascript code, and the tool will flag that as invalid JSON. Supporting new implies parsing arbitrary javascript. In fact ASP.NET AJAX has a new serialization format for dates as a result (I'll blog about this today) that does not use the new Date() ctor.

Richard Kimber

Posted on 11/14/2006 @ 12:03 PM
Great tool, exactly what I've been looking for. I can't thank you enough.

Rich

ElQuintero.net

Posted on 11/14/2006 @ 12:26 PM
¡¡¡fantastic new version!!! Thank you very much Nikhilk.

Alex

Posted on 11/15/2006 @ 2:39 AM
Nikhil - thanks a lot. the tool looks very promising. However, ASP.NET support is not working for me. I registered the module (GAC and web.config) and set the compilation/@debug to "true". I still get the "No ASP.NET info available" alert in the toolbar.

Are there additional prerequisites (yes, I started the web app with http://localhost/...)?

Thanks in advance!

Mark Hildreth

Posted on 11/15/2006 @ 7:12 AM
Nikhil,

This tool has been a life saver while working out subtle bugs (on my end) while moving to AJAX. One small addition I'd like to see is just two extra columns in the logging window. It would be great to see the total size (in bytes) of both the reqest and response. This would really help in getting pages optimized for partial postbacks. Keep up the good work!

Mark

Henning Krapoth

Posted on 11/16/2006 @ 6:48 AM
I get an error ("unexpected error") on the project page, so I'm unable to download :-(
Any alternative download links for the new version? Google only shows 0.8.3.0 to me.

Magnus

Posted on 11/16/2006 @ 11:15 AM
Mee to can't access your tool....

cem

Posted on 11/16/2006 @ 12:27 PM
I am at the VS Live conference, just came out of advanced ajax session which recommended your tool... But can't download

Nikhil Kothari

Posted on 11/16/2006 @ 3:38 PM
The site was down for some sort of maintainence on the hoster's end - its working now...

Nikhil Kothari

Posted on 11/22/2006 @ 11:10 AM
The site is up now... fingers crossed that it stays that way.

Michael Vermilion

Posted on 11/22/2006 @ 12:25 PM
This had been a great tool when debugging Ajax. I very much appreciate this. I would also like to thank you for writing that great ASP.NET Server Controls and Components book. I read that a while back and even though its out of date now, I still think it's the best book on .NET out there. Great work.

Mike

Kris

Posted on 11/29/2006 @ 5:56 AM
Great tool Nikhil, but I get a lot of NullReferenceExceptions:

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at nStuff.WebDevInfo.UserInterface.HttpTools.HttpLogConsole.ProcessNewItems()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
nStuff.WebDevInfo.UserInterface
Assembly Version: 0.5.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------

Kris

Posted on 11/29/2006 @ 6:09 AM
Nikhil, I'm afraid I had to uninstall your tool. I just couldn't access one of the websites we're working on, and uninstalling your tool solved the problem.
The website is not public, so I can't tell you where to go and test this. But it's a regular ASP.NET 2.0 site running on IIS6, accessed over HTTPS. The only thing I can think of as being somewhat special is that we are using a test certificate for the time being, i.e. one where IE7 shows a warning about not being able to validate the certificate. We just ignore that warning (click continue) and I see the login page just fine. But after logging in, IE says it can't show the second page because of "connection problems".

Daniel Michaeloff

Posted on 11/29/2006 @ 12:36 PM
Insanely cool tool! Just one issue for me: my XmlHttp responses are a small header followed by html, and the response viewer is only allowing me to view in hex. Is there a way to enable the text or html viewer on such a response? Thanks!

JacquesC

Posted on 1/11/2007 @ 3:35 AM
Hi Nikhil,

I need to submit https://www.velodoc.net to a stressing load.
How would you recomment load testing ASP.NET Ajax applications? (Cannot find a better place to ask you the question).
Visual Studio web tests work at the protocol level like Red Gate ANTS Load and we cannot afford tools like Mercury LoadRunner.
I have not found any better than iOpus iMacros + performance counters yet.

We are close to ASP.NET Ajax extensions RTM and maybe someone from the team could write a blog post on the subject.

Regards,
Jacques

JacquesC

Posted on 1/12/2007 @ 3:26 AM
Nikhil,

I have now found much better with WatiN which allows building VS Unit Tests which can then be used for load testing. Any better suggestion?

Regards,
Jacques.

Alex

Posted on 1/30/2007 @ 7:06 AM
Jacques,

You can also try SWExplorerAutomation SWEA (http:\\webiusoft.com) for VS Unit Tests . SWEA fully supports AJAX, by analyzing IE network traffic and simulating "complete" events - there is no need for "sleep" statements. SWEA records tests and generates C# or VB.NET code.

Regards,
Alex

marc de sutter

Posted on 2/17/2007 @ 8:30 PM
I try too learn

Patrick Barnes

Posted on 2/22/2007 @ 9:18 AM
For what it's worth, I also got NullReferenceExceptions when I double-clicked a URL logged by HTTP trace. I was CTRL+F5'ing an AJAX-enabled ASP.NET app from Visual Web Dev Express that was invoking an ASMX service under localhost (registered with ScriptManager on the ASP.NET page). I don't understand all the security issues, but I think there's a problem when trying to use Nikhil's tool across servers, i.e., from "localhost:[portnum]" to "localhost", at least when JavaScript is involved. My problem went away when I ran my ASP.NET app on localhost (place files under c:\inetpub\wwwroot and then in IIS Manager, right-click its folder, select Properties and click Create), instead of on the built-in server that launches with Visual Web Dev Express. Maybe this will help someone...

Adam

Posted on 3/2/2007 @ 8:39 AM
If you are interested in unit testing in VS, checked out WebAii here www.artoftest.com, comes with a VS Unit Test templates for both C# and VB.NET and you can use to automated both IE & FireFox using the same API. The Beta2 version looks like it will have support to also invoke javascript functions directly from your C# code. So you can do your javascript unit testing also VS using their unit testing framework

Yusaku Isomichi

Posted on 5/30/2007 @ 1:43 AM
aa

Yusaku Isomichi

Posted on 5/30/2007 @ 1:43 AM
aa

幻想精灵

Posted on 6/11/2007 @ 6:01 PM
Good.
Thank you very much Nikhilk.

tanvir

Posted on 6/26/2007 @ 1:14 AM
hi,
i cant d/l the files. seems like the url is down. can u please notify when it'll be up again???

dave

Posted on 3/4/2008 @ 9:45 AM
I am getting error.

Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Projects/WebDevHelper.aspx

Steve Allen

Posted on 3/9/2008 @ 2:11 PM
The page for the download is broken. When navigating using the link at the top of your article, the page throws an error:
Line 44: Project project = projectsDO.GetProject("WebDevHelper");
Line 45:
Line 46: titleLiteral.Text = project.Title;
Line 47: descLiteral.Text = project.Summary;
Line 48: detailsLiteral.Text = project.Details;

Thanks!

Vanessa

Posted on 3/21/2008 @ 4:35 PM
web development helper page give following error.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 44: Project project = projectsDO.GetProject("WebDevHelper");
Line 45:
Line 46: titleLiteral.Text = project.Title;
Line 47: descLiteral.Text = project.Summary;
Line 48: detailsLiteral.Text = project.Details;


Source File: \\webstore2\content$\winisp\nikhilk\projects.nikhilk.net\WebDevHelper\Default.aspx Line: 46

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
ASP.webdevhelper_default_aspx.OnInit(EventArgs e) in \\webstore2\content$\winisp\nikhilk\projects.nikhilk.net\WebDevHelper\Default.aspx:46
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

MarkD

Posted on 5/31/2008 @ 6:18 AM
Great work! Thanks a lot!

To get ASP.net features work under Vista (64) with IIS 7
I had to add the following to web.config:
<system.webServer>
<modules>
<add name="DevInfo"
type="nStuff.WebDevHelper.Server.DevInfoModule,
nStuff.WebDevHelper.Server,
Version=0.5.0.0,
Culture=neutral,
PublicKeyToken=8fc0e3af5abcb6c4" />
</modules>
</system.webServer>

Mark

Web Developer

Posted on 6/16/2008 @ 6:47 AM
Great work Nikhil :) I'm going to explore how it works.

Marc Roussel

Posted on 8/14/2008 @ 4:08 AM
Here's a bug

http://cid-436c774c9ac70d4d.skydrive.live.com/self.aspx/Public/bug.jpg

LyphTEC

Posted on 9/3/2008 @ 7:19 PM
This seems to install fine on IE8 beta 2... even shows it under "Manage Add-Ons" but for the life of me I can't find a way to enable it. The "Tools" menu doesn't show the "Web Development Helper" option?

Any ideas if this works with IE8 ?

vijayaKumari

Posted on 10/9/2008 @ 9:36 PM
It is very useful for me..
Post your comment and continue the discussion.
 
 
 

 

 
Refresh this form if the spam-protection code is not readable, or has expired. (Your input will be preserved)