January 5, 2009  
  You are here:  Blog

QTCommunicationSimplified50.gif


Try Radicomm's Quicktalk, the first enterprise-class Push-To-Talk application for your Motorola/Symbol rugged devices, in your distribution center for free.

Click here to enter the 21st Century.


Using Web Archive Files (.mht) For Resolving Rendering Problems
 
Location: BlogsNetSplore's Blog    
Posted by: Joe Rattz 12/18/2006 6:28:02 PM

Have you ever had to wrestle with HTML or CSS rendering issues?  Working in a compiled language environment like ASP.NET can be exasperating sometimes.  The cycle time of edit, compile, and test can get very fristrating when you are making many small changes trying to determine why something is not rendering the way you would expect.

It would speed things up considerably if you could find a way to eliminate the compiling process just to try tweaking some HTML or CSS.  You could save the rendered HTML in your browser to disk.  Then you could directly edit the file to resolve the issue.  Finally, you would edit the ASP.NET source code, compile, and test to make sure it behaved properly.  However, doing this creates the problem of pathing for images.  You may find the paths to the images won't handle the location of the saved HTML file.  If images are missing, it will cause the page to render differently, and this is no good.

You could save the HTML page to the same directory the ASP.NET .aspx or .ascx file is in.  This will resoive the image pathing problem, but this runs the risk of the file making it into production.  Lastly, writing a temporary test file into a source directory just feels like a bad practice.

 

The Solution

Taking advantage of web archive files (.mht) can eliminate the need to compile between tests to narrow down where the discrepency is occuring.  I was not aware that web archive files even existed until about a month ago.  I am not referring to a Java web archive (.war) file either.  A Java web archive file is a zipped directory of files that makes it easy to deploy a web application.  I am referring to a .mht web archive file.  This type of web archive file is an HTML file with all linked resources, such as images and audio, embedded as binary into the .mht file.  If you choose the "File | Save as" menu option, and expand the "Save as type" dropdown box.in the file dialog, you should see an option to save the file as a .mht file.  This is a simple way to create the web archive file.  So, here are my steps to resolve painful rendering issues more quickly:

 

The Process

  1. Once you have determined you have a real rendering issue that is going to require you to make several edit/compile/test cycles to resolve, run the page in Internet Explorer, and save it as a .mht file in the directory of your choice.
  2. Load the .mht file into the editor of your choice.
  3. Edit and save the .mht file, making the change you think may resolve the problem.
  4. Refresh your browser. 
  5. Repeat steps 3 and 4 until the rendering issue is resolved.
  6. Edit your ASP.NET source code to reflect the actual change necessary to resolve the issue.
  7. Compile and test your modified ASP.NET code.

Following these simple steps can eliminate many cycles of compiling, and make it far quicker to resolve tricky rendering issues.

 

Copyright ©2006 Joe Rattz
Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 
 
Module Border Module Border
My Book

 

Module Border Module Border
Blog Archive
   
    

  Home|Freebies|Blog|Services|Articles|ASP.NET Depot|DotNetNuke Central|Contact Us
  Copyright 2005 Netsplore Terms Of Use Privacy Statement