Category Archives: AJAX

ASP.NET MVC, JQuery, and SuperFlyDOM

What is JQuery? “A new type of JavaScript Library” Jquery really made my UI developement Fun. If you are not familiar with JQuery, i strongly suggest you check it out. We can do more with less code using JQuery.

And then there is ASP.NET MVC to make make web development clean and TDD friendly. If you are not familiar with ASP.NET MVC you should check out Scott Gu’s Blog posts on different previews (currently Preview 4).

There are quite a few articles on how to integrate ASP.NET MVC and JQuery to make our lifes happier. A simple google search for “ASP.NET MVC with JQuery” return quite a few articles.

Continue reading ASP.NET MVC, JQuery, and SuperFlyDOM

AJAX UpdatePanel Causes Postback

Little Known Secrete ” UpdatePanel causes Postbacks”.

Even though it is good entry point in to AJAX programming using .NET technologies, UpdatePanel does not give you much performance over traditional PostBack model.

When used, UpdatePanel causes the postback similar to the traditional postback, instantiates the control tree, and at render time realizes to send only the required response (the content in the updatepanel).

So, apart from the reduced response bandwidth and nice looking flicker free UI, updatepanel is not really getting you much performance.

Having said that, i am sure you can get away with UpdatePanel for most of your needs.

I would try to supplement this with more information.

AJAX Usability Question when the screen is being updated

 

I am working on a simple web application that aggregates RSS from different Online Deal Site in to one place. One of the things I wanted to do was to have one page and load the RSS details in to an Update Panel. I know Update Panel is not the best when it comes to performance but it does its job and with proper caching on the server side, it is very good for my purpose. And more over this blog is not about the merits and/or de-merits of UpdatePanel but on Usability from an end user perspective.

I was using “UpdateProgress” from AJAX control tool kit and it is working very well with simple “update message” while the update panel is being processed. But, there are times when there is not any delay and the “Progress Bar” is not coming up. This may not be the desirable condition as user might not recognize that the screen has new information.

So, I needed some thing more to say that the screen has been updated. I looked in to “UpdatePanelAnimationExtender” to work with the condition. This Extender supports Animations while the screen is being updated and after the update.

 

<cc1:UpdatePanelAnimationExtender ID=”UpdatePanelAnimationExtender1″ runat=”server” EnableViewState=”false” TargetControlID=”UpdatePanel1″>
<Animations>
<OnUpdated>
<Sequence>
<EnableAction Enabled=”true” />
<Color AnimationTarget=”UpdatePanel1″
Duration=”.5″
z-index=”5″
StartValue=”#FFCC99″
EndValue=”#FFFFFF”
Property=”style”
PropertyKey=”backgroundColor” />
</Sequence>
</OnUpdated>
</Animations>
</cc1:UpdatePanelAnimationExtender>

In addition to this I could have another animation to show while the target update panel is being updated with entry like

<OnUpdating>

</OnUpdating>

But I am not sure if this would inform the intended message to the end user! So I have decided to go in-between route. Show the “Progress Bar” while the update panel is being updated and show a simple color transition when the panel is being updated.

To outline the code is looks something like this

<asp:UpdatePanel id=”UpdatePanel1″>

<ContentTemplate>

<asp:UpdateProgress ID=”UpdateProgress1″ runat=”server”>
<ProgressTemplate>
<div class=”ProgressClass”>
Please Wait While the Page is Loading…
</div>
</ProgressTemplate>
</asp:UpdateProgress>

<asp:GridView>

</asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

<cc1:UpdatePanelAnimationExtender TargetControlID=”UpdatePanel1″>

</cc1:UpdatePanelAnimationExtender>

You could find more about these controls here

-Thanks,

Error: "Sys" is Undefined error

I was playing with AJAX enabled applications for some time but not really done any thing major yet. I was working on a small project that required me to add some AJAX functionality using simple updatepanels. I dropped the necessary controls like scriptmanager and updatepanel in to the page and added the references to System.Web.Extensions.

I ran the application and ran in the error message mentioned above.

Error: “Sys” is Undefined Error

I read some blogs and added another reference to “System.Web.Extensions.Design” and added some

<handler> tags to the web.config file.

Nothing seemed to work and I still had the issue.

I got smart at this time and created a new AJAX enabled web site in Visual Studio and copied the web.config file over to my existing application.

The error message is gone!!!

An Introduction to JSON in JavaScript and .NET

I found this An Introduction to JavaScript Object Notation (JSON) in JavaScript and .NET article to be very useful especially if you are new to JavaScript Object Notation (JSON)

Explore some of the Object Oriented Techniques of JavaScript, check this MSDN article, http://msdn.microsoft.com/msdnmag/issues/07/05/JavaScript/default.aspx, by Ray Djajadinata (Ray Hsieh).

Happy Scripting!!!