Asp.Net

Troubles When Developing With AJAX

For those that are not familiar with AJAX, the word is an acronym for Asynchronous JavaScript + XML. AJAX is not new to the scene. In fact, even the newest advances in AJAX are at least five years old. Yet AJAX is becoming the buzz word in developing. AJAX is a very powerful technology that allows you to build a website with incredible functionality without users having to refresh the web page they are on. However, there are some “bumps� in the road when trying to utilize AJAX.

What does AJAX do? Basically, it makes it possible for a group of techniques to have interactive web applications to use Javascript to process XML/XHTML, with CSS, in a browser without having to reload the entire web. In other words, AJAX allows the browser and web server to synchronize the exchange of data, making the interaction and reloading of each web page faster.

One of the problems with Ajax is that its updates often contain information retrieved from a script running on the server side. It is very common for a browser to not display any kind of visual indication that any portion of AJAX is loading. The developer can’t see this interaction first hand, so it’s difficult to see exactly where to go in the application to be able to determine whether the client-side JavaScript is correctly communicating with the server or not. A solution for this is why it’s imperative to insert a visual indicator that will allow you to know something is occurring. You can use a visual swirl very similar to the ones used when a light box image is loading.

Another solution is to use Firebug to monitor HTTP communications. Let’s say that the page did not load as expected, or didn’t render precisely. By using the Firebug feature you’ll be able to determine if the HTTP communications flow is processing properly as the page loads, followed by including the jQuery library and the correct interaction of the server-side-script with the inclusion of the JavaScript mechanism. By using Firebug you will be able to see if the HTTP payloads between the client and server are communicating properly.

Another problem with AJAX is the problem of getting the “Back Button� on the browser to work properly in the JavaScript application. Developers asking for problems in their web applications if they fail to install a way for their content to reload automatically if the user tries to use the browsers back button. This happens when developers over use AJAX without trying to balance with other technologies.

Many developers and designers forget that despite the advanced technologies and the amazing evolution of the web, there are still some users that do not have a strong and stable internet connection. A good example of this is seen if you have ever played internet poker and noticed how many delays there are because other players keep losing their internet connection. There are still users that have small monitors and dial-up modems. Not everyone has a Mac Pro Quad-Core Intel Xeon “Nehalem� processor with a 30� monitor.

As a web developer or designer, there are times when you might consider using other means of interaction with your users to allow you to reach a wider audience. AJAX requires interaction with XML and JavaScript which will leave users with poor connections out in the cold.

As I mentioned above, a designer or developer to be successful and be able to reach a larger audience needs to have a balanced platform. I am not suggesting that you need to eliminate AJAX technology, because it is a super way to develop intriguing JavaScript applications. What I am saying is you must make sure your code is efficient and clean and you use AJAX sparely, or as needed. You also need to make sure you have all your bases covered and that all of the AJAX support information needed is in the proper place. Remember, the more AJAX running, the slower the web pages will load, which is completely opposite of the reason AJAX is so powerful.

One final point – search engine spiders have extreme difficulty trying to pick up content when AJAX is trying to load large amounts of text. Hence, the content isn’t published and indexed properly. Spiders need static content to be able to read it.

Ajax developers at times might need to develop almost two types of applications if they want to build an online application good for Firefox and Internet Explorer browsers that could require a lot more time for application development. The end result however, is well worth it. A highly efficient Ajax based application does not only provide eye catching features but could easily provide a highly effective application with processing speed that almost rivals any simple web-based application.


Optimizing ASP.NET 2.0 Web Project Build Performance

This posts covers how to best optimize the build performance with Visual Studio 2005 when using web projects. If you are experiencing slow builds or want to learn how to speed them up please read on.

Quick Background on VS 2005 Web Site Project and VS 2005 Web Application Project options

VS 2005 supports two project-model options: VS 2005 Web Site Projects and VS 2005 Web Application Projects.

VS 2005 Web Site Projects were built-in with the initial VS 2005 release, and provide a project-less based model for doing web development that uses that same dynamic compilation system that ASP.NET 2.0 uses at runtime. VS 2005 Web Application Projects were released as a fully supported download earlier this spring, and provide a project model that uses a MSBuild based build system that compiles all code in a project into a single assembly (similar to VS 2003 — but without many of the limitations that VS 2003 web projects had with regard to FrontPage Server Extensions, IIS dependencies, and other issues). To learn more about VS 2005 Web Application Projects, please review the tutorials I’ve published on my http://webproject.scottgu.com web-site. Note that VS 2005 Web Application Project support will be included in VS 2005 SP1 (so no additional download will be required going forward).

Both the VS 2005 Web Site Project option and the VS 2005 Web Application Project option will continue to be fully supported going forward with future Visual Studio releases. What we’ve found is that some people love one option, while disliking the other, and vice-versa. From a feature perspective there is no “one best option” to use – it really depends on your personal preferences and team dynamics as to which will work best for you. For example: a lot of enterprise developers love the VS 2005 Web Application option because it provides a lot more build control and team integration support, while a lot of web developers love the VS 2005 Web Site model because of its “just hit save” dynamic model and flexibility.

Two articles you might find useful to decide which works best for you is this MSDN whitepaper that includes some comparisons between the two models, and Rick Strahl’s Web Application Projects and Web Deployment Projects are Here article that provides a good discussion of the pros/cons of the different options.
(continue reading…)


Navigate between design-view and source-view within Visual Studio

You have a large ASP.NET page that you are working on within Visual Studio, and you want to quickly navigate back and forth between design-view and source-view without getting lost in the deeply nested HTML content, or have to spend a lot of time finding your place again in the document.

Solution

Visual Web Developer and Visual Studio 2005 provide a number of subtle, but useful, features that you can take advantage of to navigate quickly around an HTML page. To see them in action, open a page with a lot of HTML content (in the examples below I’m going to use the Default.aspx page from the built-in “Personal Starter Kit” sample).

Switch the page into design-view and either select some content, or simply move the cursor to a location within the page where you want to examine the HTML. For example, in the screen-shot below notice that I’ve selected the “ipsum” text within the second <li> of my <ul> list:

Now click the “source” tab within Visual Studio and notice the text selection and cursor within source view:
(continue reading…)


  •   
  • Copyright © 1996-2010 BlogmyQuery - BMQ. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress