Ajax Control Toolkit with ASP.NET MVC#

I have been playing with ASP.NET MVC for about 4 months now and have a couple sites, one decent sized, in production right now.  I am very comfortable with it and the extra control over the html is very nice.  Since there is no postback and viewstate in MVC, the Ajax Control Toolkit does not work as designed and needs a few changes to make it work within the MVC framework.  It has forced me to look at jQuery more, and I am really enjoying the simplicity of jQuery's design and the power of using it.  I was just wishing I could use some of the controls in the toolkit and of course i wanted to see if i could get it to work for the sake of making it work.  Well I did get it to work for 2 of the controls so far, some that i use in a normal project.  They are the Calendar and TextBoxWatermark. 

To make this easier, and from a lesson I learned with jQuery, it is best to select your DOM elements by a css class when you can.  This allows for your JavaScript to be more unobtrusive, and ultimately cleaner and easier to maintain.  So i took a couple of methods from the Ajax Futures from last July 2007 and put it in a helper class along with a simple function of mine to allow selection of DOM elements by css very trivial.

To give you an idea of what i am talking about using css selectors for the toolkit, look at this sample:

var elements = $select('TextboxWatermark');
    for (i=0;i<elements.length;i++)
    {
        var elem = elements[i];
        $create(AjaxControlToolkit.TextBoxWatermarkBehavior, {"WatermarkText":elem.title}, null, null, $get(elem.id));
    }

 

I created a helper function $select(className) which basically wraps Microsoft Ajax Futures getElementsByClassName like such:

function $select(className)
{
    var elements = Sys.UI.DomElement.getElementsByClassName(className);
    return elements;
}

So basically if you put the class name TextboxWatermark on any textbox input with the title you like to show as the watermark like this:

<input type="text" class"TextboxWatermark" name="username" id="username" title="Must be at least 6 chars" />

or

<%= Html.TextBox("username", new { @class = "TextboxWatermark", @title = "Must be at least 6 chars" }) %>

What is nice about the second option is that you get the added benefit of getting the View Engine to fill out the value of the textbox if there is an item in ViewData of the ViewData.Model that has a var named 'username'.

So I find this much easier than having to add the control and on each page and for each DOM element i want to attach this behavior to. 

When you want to do the same thing with other controls, you need to know how to call it in JavaScript.  This is the part that is kind of hidden when you are using controls like in WebForms.  If you go to the AjaxControlToolkit Sample Site, and view page source on one of the controls example pages, you will see what JavaScript is generated.  Go to the TextboxWatermark example and then view source from the browser.  You will see 5 of these at the bottom for each control

Sys.Application.initialize(); Sys.Application.add_init(function() { $create(AjaxControlToolkit.TextBoxWatermarkBehavior, {"ClientStateFieldID":"ctl00_SampleContent_TextBoxWatermarkExtender1_ClientState","WatermarkCssClass":"watermarked","WatermarkText":"Type First Name Here","id":"ctl00_SampleContent_TextBoxWatermarkExtender1"}, null, null, $get("ctl00_SampleContent_TextBox1")); });

So this is how you can see how to invoke that control with the arguments, and then of course looking at the source files help you see what else they are doing.  I am already feeling cleaner with the JavaScript since i have just one function that now does it for every Dom element with the class name, "TextboxWatermark".  Here is the function that gets called on pageLoad.  This will attach the behavior for each Dom element.

function AddAllTextboxWatermarks()
{
    var elements = $select('TextboxWatermark');
    for (i=0;i<elements.length;i++)
    {
        AddTextBoxWatermark(elements[i]);
    }
}

function AddTextBoxWatermark(elem)
{
    $create(AjaxControlToolkit.TextBoxWatermarkBehavior, {"WatermarkText":elem.title}, null, null, $get(elem.id));
}

Now the Calendar was just as easy to put in the form.  Here is how I implemented the Calendar:

<%= Html.TextBox("calendar", new { @class = "Calendar" })%>

Now, the calendar was a little tougher to get to work cause of getting the JavaScript just right cause of the amount of files needed.  The Calendar is one of the more complex controls since it uses a popup behavior, animation, timer and threading among others. 

So, that solves simple controls, but what about other controls that need overloads and are not as simple parameter wise.  Well I put all these controls in html helpers also that inject the JavaScript at run time.  I actually started this way, but after using jQuery a little, i really wanted to see if i could implement this using css selectors with the asp.net Ajax framework.  Also it felt like black box controls were creeping back in, but sometimes we need to generate html in c#, so i think it is just about finding the fine line when not to do it and when it is simple and reusable.

Here this an example of the TextboxWatermark as a Html helper:

<%= Html.TextboxWatermark("Enter Username", "username", true) %>

So basically this returns you the input text box,  with the TextboxWatermark behavior attached.  Also it will make sure that the appropriate .js files are in the page along with the html needed to make it work with this particular control.  Now this creates a lot more code in the page just like the controls now do in the existing toolkit, but has its own advantages.  We can create overloads and add additional parameters without having to write JavaScript.  Some people actually don't like to write JavaScript, it is either intimidation or fear of messing up something I guess.  Personally I have used it since the late 90's and is the only language that I have used for 10 years.  Well that and SQL. 

The Calendar control has advantages to being used as a Html helper since we can have several overloads to define format among other parameters that a calendar control can take.  Here is how you set the format:

<%= Html.Calendar("bDay", "MM/dd/yyyy") %>

Also lets say you want a button to invoke the menu, not just clicking in the textbox.

 <%= Html.Calendar("calBtn", "txtDate", "MM/dd/yyyy")%>
 <input type="text" id="txtDate" name="txtDate" />
 <input type="button" id="calBtn" name="calBtn" value="Pick Date" />

Here is a download of a working project with all the necessary files you need to make these controls work either with CSS Selectors or with Html helpers.  I basically created a new mvc web app from scratch using their new templates in Preview 4 that has the membership stuff in it, so that it works with the base starter project that Microsoft provides. 

Download: http://www.jimzimmerman.com/downloads/MvcPreview4AjaxToolkit.zip

Tell me what you think.  I hope you find it useful.  I am leaning towards doing everything with CSS Selectors, but am finding it pretty helpful to use Html helpers also.  I am working on Collapsible Panel and Popup Control next.  I know the Microsoft Ajax team is working on some things with the Toolkit also and look forward to seeing how they integrate it.

Saturday, August 16, 2008 6:27:40 AM UTC #     |  Trackback

 

ASP.NET MVC CTP is Out#
Monday, December 10, 2007 12:09:55 PM UTC #     |  Trackback

 

Visual Studio 2008 beta 2 JavaScript Intellisense broken#

I was preparing for my session for Jacksonville Code tonight which is coming in a few days and noticed that my JavaScript intellisense no longer worked in Visual Studio 2008 beta 2.  Since part of my session requires that intellisense works and the fact that it is so much easier to write JavaScript, I was in a little bit of a panic.  I looked up the problem in Google and found this post, 

http://blogs.msdn.com/angus_logan/archive/2007/07/30/visual-studio-2008-beta-2-not-showing-your-javascript-intellisense-intellicode-syntax-highlighting.aspx

Basically two registry entries that must have gotten messed up when I uninstalled beta 1 and installed beta 2:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\CLSID\{014E9A41-54E5-44ED-B15E-EFFA8758BFFC}]

"CodeBase"=file:///C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\Microsoft.JScript.AuthoringServices.dll

and

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\CLSID\{014E9A41-54E5-44ED-B15E-EFFA8758BFFC}\InprocServer32\9.0.0.0]

"CodeBase"=file:///C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\Microsoft.JScript.AuthoringServices.dll

Gotta love the community! 

Thanks!

Friday, August 24, 2007 9:51:07 AM UTC #     |  Trackback

 

Practical Guide to Web Browser Testing for Ajax and CSS#

If any of you write web applications for larger clients you are probably starting to see the same issues I am.  There are too many browsers to support now!  Welcome to browser hell.  It is beginning to drive me crazy.  Here are the latest stats from w3 schools on browser usage:

Browser Statistics Month by Month

2007 IE7 IE6 IE5 Fx Moz S O
June 19.7% 37.3% 1.5% 34.0% 1.4% 1.3% 1.8%
May 19.2% 38.1% 1.5% 33.7% 1.3% 1.4% 1.7%
April 19.1% 38.4% 1.7% 32.9% 1.3% 1.5% 1.6%
March 18.0% 38.7% 2.0% 31.8% 1.3% 1.6% 1.6%
February 16.4% 39.8% 2.5% 31.2% 1.4% 1.7% 1.5%
January 13.3% 42.3% 3.0% 31.0% 1.5% 1.7% 1.5%

 

This especially becomes an issue when you are are writing bleeding edge apps using Ajax and silverlight and developing on a vista machine.  Well first you need a way to test IE 6.  I have given up on IE 5, but there is a decent solution for testing with IE 6 on vista or any other machine where you are already running IE 7.  See you can't run both browsers at the same time.  So I run virtual PC 2007 which is free.  They have a A VPC hard disk image containing a pre-activated Windows XP SP2, and either IE6 or IE7 and the IE7 Readiness Toolkit: Internet Explorer Application Compatibility VPC Image.  The VHD expires August 2007, but I bet there will be an update to the expiration date soon.

Now you have IE 6 ready to test, but what about the others.  Obviously you need firefox and might as well download safari for windows and Opera.  Now I realize that safari only says 1.3% above, but many of you may have a client that works on a mac, which I do.  So now I have to support Safari 2. whatever on the mac OS x.  Now this one is a pain to support.  I am trying to figure out how to do this currently and have come up with a couple of solutions.  First you are not allowed to create a virtual image of mac OS x using vmware or virtual PC because apple does not allow it.  I guess they want you to buy and ibook and virtualize vista. But I think I may have found a way to virtualize mac os x on vista.  I am going to try it this week and let you know how it goes.  It looks kind of painful so I may just use a paid service, browsrcamp, which offers a vnc connection to a mac.

So now we know what browsers to test and how, lets look at what libraries we should use for Ajax.  ASP.NET Ajax is one obvious answer.  It comes with built in support for all the browsers I have mentioned above and is fairly easy to use.  Now I am a little biased, but I also have worked with jQuery which is also a nice Ajax library and has a strong community also.

When you are running your tests if you regularly validate your html, you will save hours ahead of time before you run your manual tests.

Good luck and may the browser be with you!

Monday, August 06, 2007 10:46:39 AM UTC #     |  Trackback

 

A Day of Ajax in Tampa changed to 6/21/2007#

I guess there has been a double booking of the Microsoft room for the 20th, so we had to move it to the 21st.  I hope you all can still make it.  we will all be speaking at Tampa Code Camp also on July 14th, so try to catch us there if you can also.  I will be showing some Silverlight and Ajax stuff at Tampa Code Camp.

Sunday, June 17, 2007 7:44:57 AM UTC #     |  Trackback

 

A Day of AJAX in Tampa on 6/20/2007#

A few of us are having a Day of AJAX in Tampa, FL on June 20th, 2007 from 8:30 - 5:00.  This will be a fun day of learning ASP.NET AJAX for free put on by ASPSOFT, Microsoft and DevFish.NET. Join us for a deep dive into the intricacies of Ajax development using the Microsoft suite of tools. The agenda for the day will be:

8:30am - 9:00am : Registration and welcome
9:00am - 10:30am : Joe Healy ::  Introductions :: An overview of Microsoft Ajax
10:30am - 10:45am : BREAK
10:45am - 12:15pm : Jim Zimmerman :: Building controls and extenders
12:15pm - 1:00pm : LUNCH (pizza and soda)
1:00pm - 2:30pm : Jay Kimble :: Ajax Best Practices
2:30pm - 2:45pm : BREAK
2:45pm - 3:45pm : Joe Healy :: Ajax and JavaScript in Visual Studio "Orcas"
3:45pm - 4:00pm : Giveaways (including a Zune!)
4:00pm - 5:00pm : Open dialog with attendees

All topics are covered at a 200-level. Space is limited, so register early to get your seat at A Day of Ajax!

Go to https://www.clicktoattend.com/invitation.aspx?code=118815 to register.  I think there are only about 75 seats available, so you will want to register as soon as possible to get in.

Look forward to seeing you there.  Hopefully I will have a few copies of Beginning ASP.NET 2.0 AJAX to give away at the event.

Thursday, May 24, 2007 11:23:08 AM UTC #     |  Trackback

 

ASP.NET AJAX From Scratch Webcast Download#

MSDN has uploaded the Webcast I did last week.  It was my first one so there is some funny mess ups in the beginning.  I didn't know how to get back to the live meeting slides after switching to share my applications.  the host had to get on the line and tell me what to click.  Oh well.  I won't make that mistake again.

If you want to view it you can see it on-demand here, ASP.NET AJAX From Scratch MSDN Webcast.  I would love to hear any feedback you may have.

Thursday, May 24, 2007 11:08:22 AM UTC #     |  Trackback

 

ASP.NET AJAX from Scratch Webcast#

I got asked to help with a Webcast due to scheduling conflict and will be giving a Webcast on Monday May 14th at 12:00 p.m.  SDN Webcast: Russ and Joe Developer Show: ASP.NET AJAX from Scratch (Level 100) is where you can register online or download later.  I don't know when or if they will offer it as a download, but I will keep you posted when I find out.

I will be going over some basic stuff with UpdatePanel and some of the controls in the Ajax Control Toolkit.  I also will go over a cool demo using the Ajax Library to write my own class using Orcas Beta 1 and showing off intellisense with JavaScript.  It is truly amazing to reference my own JavaScript class and then see the properties and methods using intellisense when calling the class in the aspx page.

Monday, May 14, 2007 9:34:32 AM UTC #     |  Trackback

 

New Book - Beginning ASP.NET 2.0 AJAX#

For those few that actually subscribe to my blog and were wondering if i fell from the face of the earth, well I did.  I have just returned from planet AJAX and am still having dreams of intellisense for JavaScript.  The lead author is having a hard time deciding on which cover to choose and is wondering what you think over at his blog. :) If you go to that post, it is the only real proof that i have that i have been working on a book with five other AJAX gurus as we think we are.  It also looks like Wally has been working on some other books in his WTF series that i was unaware of.

Writing a bok has been one  of the biggest challenges of my career.  At first I thought, "How hard could this be?"  Well it is very challenging and takes about 2-3 times more work than you would think.  With all the revisions that you must go through and the research into things that you thought you knew, it takes a toll. 

 I must commend my wife for being as patient as she has been with all the late nights i had been wirting.  The first official printed copy will be signed by me and given to her.  Although she will not understand a thing i said in the chapters i wrote, she will at least see that is is real and i wasn't just typing in my MSN instant messenging client.

I will be blogging much more often in the weeks to come.  Hopefully you haven't all deleted your subscription in your RSS reader yet. :)

Sunday, April 29, 2007 4:56:06 PM UTC #     |  Trackback

 

IntelliSense for JavaScript using Visual Studio Orcas#

Although I have known for a while that there was going to be IntelliSense for JavaScript in the next version of Visual Studio, this is the first time I have seen a public post from the team on how it will work.  I just ran across this post: http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx that shows real examples of how this will work.  I am so excited to use this tool.  If only i could use it now.  I feel that there must be a beta coming sometime soon.

 | 
Friday, March 09, 2007 9:16:26 AM UTC #     |  Trackback

 

ASP.NET AJAX 1.0 Released#

ASP.NET AJAX 1.0 has just released!  We can now start to write great AJAX applications that will be fully supported.  They may have taken a while, but that is too be expected when they create a massive base framework that will be supported across multiple browsers.  This is not an easy task. 

This is a huge step to great things with using AJAX with ASP.NET 2.0.  I know there are a lot of frameworks out there, but this is one that will be around for awhile and is easily contributed to.  They have also extended the JavaScript language so that it feels a little bit more like C# and wait until they release the new Visual Studio where we will get intellisense for JavaScript.  I am so excited to see this in action.

Be sure to check out ajax.asp.net and watch some of the video demos they have and implement their code samples.  While we have all seen demos like this before, we can actually implement these scenarios in a supported environment.  Have fun!

 |  | 
Wednesday, January 24, 2007 11:52:38 AM UTC #     |  Trackback

 

ASP.NET AJAX 1.0 RC has been released#

You can now download the Release Candidate of ASP.NET AJAX 1.0.  It is time to get your app's ready.  I am pretty sure we will not see too many changes at all now and can confidently write code that will be used when it ships next month. 

This has been a long wait, but well worth it.  I am sure that this framework will grow and grow as it matures.  It has been a little painful to wait this long for a release, but is well worth it.  These guys have worked so hard to come up with a release that works cross browser and is easy to use to develop with and is relatively bug free.  I am excited to all the new features that will be added once there is a 1.0 release.  I think people will really embrace it and add many controls that can be shared across the community.

 |  | 
Friday, December 15, 2006 10:53:02 AM UTC #     |  Trackback

 

Virtual Earth on Blawg.com#

I just released an implementation of the newest Virtual Earth on blawg.com today that mashes up all of the blawgers in the US and soon the world.  In case you wondering a blawger is someone in the legal industry that blogs. 

It has some cool balloons that pop up when you hover of the rss icons on the map that show information about that blawger. 

The new version of virtual earth has really come a long way and has some really cool features that allow you to plot directions, Ajax callbacks, zooming, adding pushpins, etc.  Check out the Virtual Earth SDK and play around with it when you have time.  They have really good documentation and many features that make it fun to play around with.

Thursday, December 07, 2006 8:04:50 AM UTC #     |  Trackback

 

ASP.NET AJAX Beta 1.0 Release#

You can now download the new Atlas or shall I say ASP.NET AJAX.  They have several downloads including the toolkit with a ton of cool controls for asp.net Ajax and also a library for non asp.net users.  Pretty cool stuff. 

You know they say they are going to commit to this for 10 years.  I don't know about you, but anyone who is going to support this type of technology for 10 years is one that you should be getting to know now.  This is not going anywhere and you know Microsoft will always be adding features to this stuff.

 |  | 
Tuesday, October 24, 2006 8:13:16 AM UTC #     |  Trackback

 

Atlas Control Toolit September Release#
Well the guys at Microsoft released the September release of the Atlas Control Toolkit. This is a great release with some cool features like animation and nobot along with some cool sliders. My balloon did not get in this time around because of some unforeseen bugs. Those guys are fun to work with and they work very hard. I see code check ins at midnight and sometimes 3 in the morning. They really worked hard to get this release solid and you can tell when you look at it. Have fun! The animation stuff is really amazing. You would swear its flash.
 | 
Thursday, September 21, 2006 8:00:00 AM UTC #     |  Trackback

 

Wow a fix to the back button problem in ajax#
I don't know about you all , but I think the biggest ajax problem is the "back button problem". For example, I built this cool build a car application and my wife would click the next button and then when she wanted to change something and go back she would hit the back button and say, "What happened? Where did the car go?". That was when I realized that we had to come up with a solution for the back button browser problem in ajax. Well it looks as if Nikhil has come up with a good solution for this problem here: http://www.nikhilk.net/BackButtonSupport.aspx . I haven't had time to implement his stuff, but he is the father of Atlas, so I am sure it probably works as advertised. He has some great stuff on his site on how to implement it.
 | 
Wednesday, September 13, 2006 8:00:00 AM UTC #     |  Trackback

 

Microsoft AJAX Library and ASP.NET 2.0 AJAX Extensions will be supported in Visual Studio 2005#
Scott Guthrie just announced Atlas 1.0 Naming and Roadmap. This is great because it will be released to work with vs 2005 and be fully supported. They listened to alot of people that want the new technology now and they are delivering. Here is a little excerpt of what he said:

"Many people have asked us to deliver a fully-supported 1.0 release of �Atlas� before the next release of Visual Studio. �Fully supported� means that Microsoft product support services are available 24 hours a day, 7 days a week, 365 days a year and that any customer can obtain hotfixes if they encounter a bug affecting their application. It also means that the product has a committed servicing product lifetime of 10 years � which provides companies with the ability to depend on it for mission critical applications.

I am excited to announce today that we are going to ship this fully supported �Atlas� 1.0 release on top of ASP.NET 2.0 and ensure that it works with Visual Studio 2005. Our goal is to ship the �Atlas� 1.0 release around the end of this year. The plan is to first have a Beta, then an RC, and then decide on the final date based on customer feedback."


Good stuff!
 | 
Tuesday, September 12, 2006 8:00:00 AM UTC #     |  Trackback

 

How to make your javascript run faster in IE#
Here is a great post on how to increase the speed of you javascript in IE from the IE Blog. http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx
It has some very valuable information on how to optimize your javascript. I am already changing some of my code.

Also here is a good post from Nikhil about Script Loading Tips. He has some good info on how to load scripts sooner than window.onload. It's some pretty cool stuff.
Have fun!
Tuesday, August 29, 2006 8:00:00 AM UTC #     |  Trackback

 

Nice primer on Microsoft Atlas from AjaxWorld#
Funny, i Just found out there is a magazine for Ajax called AjaxWorld. There are probably more magazines out there dedicated to Ajax, but i have not run into them yet. I ran into this article today and thought I would share it with you. It is a nice primer for those of you wanting to learn more about the features and potential of Atlas from a third party perspective.
 | 
Thursday, August 03, 2006 8:00:00 AM UTC #     |  Trackback

 

New Atlas Control Toolkit Released#
Microsoft just released the first Atlas Control Toolkit with controls from non-microsoft authors. My balloon control did not make it into this release but will be put in the next one to allow for proper testing. There are some cool new controls that I think everyone will enjoy. I especially like the ratings and dynamicpopulate control. Shawn Burke did a great job on the DynamicPopulate Control and I thank him for allowing me to add the customScript feature so that you can call javascript to populate a control instead of a web service or a page method. Sometimes this can be very useful.

Have fun!
 | 
Wednesday, August 02, 2006 8:00:00 AM UTC #     |  Trackback

 

Nice simple ajax / atlas demo#
Here is a very simple tutorial I saw on code project on how to use atlas to create a quiz. I like it because it shows how simple you can write atlas apps using straight javascript and html, but still using the atlas library to do the web service call management. Alot of times this is how I prefer to write ajax / atlas apps. I am also a big fan of the atlas toolkit, because you can resuse javascript now in such a cleaner way. Check out the toolkit here. And if you are so bold as to want to play with the source code, you can find that here.
 | 
Tuesday, August 01, 2006 8:00:00 AM UTC #     |  Trackback

 

Script# Prototype from Nikhil#
Now this is some very cool stuff. Nikhil, the architect of Atlas, has released a prototype to create atlas / ajax apps in c# without writing javascript code. You can check the post and download some bits here. I haven't had time to play with it yet, but I will post a review when I do. I actually like writing javascript, but i will try anything that makes life easier when writing complex ajax apps.

Have fun!
 |  | 
Wednesday, May 24, 2006 8:00:00 AM UTC #     |  Trackback

 

XmlHttpRequest Debugging for IE#
I recently ran into this post from Julien Couvreur on his blog. He ported his XMLHttpRequest Debugging user script that works with firefox to IE. You can check out more about it here. I tried it out and it works pretty slick.
Monday, May 15, 2006 8:00:00 AM UTC #     |  Trackback

 

Over 50 Ajax Frameworks#
Wow, I had no idea there were so many ajax frameworks. Here is the list of 50 that I found here. I guess it makes sense since it is so new and everyone likes to have full control, so they write their own. I know I did also, but it is no where close to the quality to let anyone else use it.

Although I am slightly biased, my choice is Atlas.
I am now migrating all of my old ajax stuff to atlas. I have played with many frameworks, and Atlas is by far the most complete. It is a little more complicated, but also more powerful. It really is an extension of JavaScript and I predict will be the standard way to implement good practices ajax programming. Anyone wanting to get involved with ajax programming in asp.net 2.0 really needs to be using Atlas. Microsoft is adding some cool features and it will integrate right into the Visual Studio IDE. This is where the future is headed, so no need to learn frameworks that you will be porting from in the future.

Have fun!
Friday, May 12, 2006 8:00:00 AM UTC #     |  Trackback

 

Atlas Control Kit Updated#
The new Atlas control kit has been updated a few days ago. This release incorporates a bunch of community feature feedback, fixes a lot of bugs, adds support for the Safari browser, and introduces another 4 new Atlas-enabled controls to the 9 introduced with the first release. You can download it from this link: http://atlas.asp.net/default.aspx?tabid=47&subtabid=477.

Have fun, the controls make it really easy to add atlas functionality to your site.
 | 
Wednesday, May 10, 2006 8:00:00 AM UTC #     |  Trackback

 

Fix for live.com gadget javascript error from localhost#
The other night I was doing a quick session on how to make live.com gadgets using Atlas. I couldn't actually show the atlas way working because I was getting a javascript error of 'm_contentIE is undefined'. I had to resort to just the xml, js, and css files way the live.com folks do it. The new atlas:Gadget control makes it so much easier. To get it work you have to add more trusted sites like *.start.com, *.live.com and localhost in internet explorer security settings. The * is what does it. Covers all current and future subdomains. This is only if you are testing from localhost as far as I know. Here is a post on it, that was shown to me during my session by Joe Healy.
http://microsoftgadgets.com/forums/5184/ShowPost.aspx .
I thank him for showing me that, I was about ready to pull my hair out debugging the live.com javascript code earlier that day getting ready for my session. Found out the reason I was able to get raw xml way working was because I Could set binding options inline = true. When using atlas:gadget you are stuck with the xml that is generating when calling page.aspx?gadget=true. I hope this helps at least one person trying to fix this problem.
 | 
Monday, May 01, 2006 8:00:00 AM UTC #     |  Trackback

 

Debugging Javascript with Visual Studio 2005#
Ok, now some of you may already know this, so don't laugh too hard that I have been writing Ajax - style apps for almost a year and have just been using fiddler to do most of my debugging. If you have not heard of fiddler you can get that here.

Anyway, I stumbled across a very easy way to debug javascript with Visual Studio 2005. I assume this also works for older versions. All that you need to do is put debugger; on the line where you want to set a breakpoint and then open the page in IE and it will ask you if what debugger you want to use. Note: You need to make sure you are allowing javascript to be debugged in IE by checking the appropiate checkbox in intenet options > advanced.

Once the debugger is open you can step though the code like you normally would in a c# app and watch the variables. If you are making ajax calls and returning xml or javascript you can also see that data come back. If you are using JSON you can actually continue stepping through that code that was returned from you server in runtime. Pretty cool stuff! It has just made my life so much easier and I am suprised I have not heard of this before. I guess I had my head in the sand for a little bit. I hope this helps someone who has been looking for how to do this.
 |  | 
Friday, April 14, 2006 8:00:00 AM UTC #     |  Trackback

 

Atlas Control Toolkit#
Looks like some people have been listening to us developers about what we want. Microsoft has released shared source controls to simplify Atlas development. Pretty cool stuff. I am already starting to create controls. Have fun!

http://atlas.asp.net/atlastoolkit/

 | 
Thursday, April 13, 2006 8:00:00 AM UTC #     |  Trackback

 

Web Development Helper - Great Ajax Debugger for IE#
Here is Nikhil's Web Development Helper. This is a great tool for debugging ajax and atlas applications. Check it out here: http://www.nikhilk.net/Project.WebDevHelper.aspx


Make sure to follow instructions carefully to get this to work. Only will work on your own .net apps.
 | 
Saturday, March 11, 2006 10:00:00 AM UTC #     |  Trackback

 

Start Developer Center#
Some cool stuff microsoft is doing with AJAX - style applications. This site is very new and not yet complete, but you will get an idea of what they are doing. Pretty cool stuff.

http://start.com/developer/default.htm
Wednesday, September 21, 2005 8:00:00 AM UTC #     |  Trackback

 

Atlas Info#
Here is a link to a look at the Atlas technology.

http://beta.asp.net/default.aspx?tabindex=7&tabid=47

I am looking at it myself and hope to incorporate this into my presentation on Saturday, Sept. 24th, 2005 in Tallahassee for Code Camp.
 | 
Monday, September 19, 2005 8:00:00 AM UTC #     |  Trackback

 

AJAX Now with ASP.NET 2.0#
I led a session on Saturday for tampa code camp called AJAX Now with ASP.NET 2.0. I had a great time and really enjoyed discussing code with fellow developers.

Here is the powerpoint of the session.

Here is the project for using script callbacks in ASP.NET 2.0. I created a delegate class that allows you to call multiple methods using script callbacks instead of being stuck with just one call and one return.

Also i have taken code from Jason Diamond and made it work with ASP.NET 2.0. Here are the project files using vs 2005 beta2.

You can also see his source here on his blog.

Any questions or comments please feel free to post.
Monday, July 18, 2005 8:00:00 AM UTC #     |  Trackback

 

 

All content © 2014, Jim Zimmerman
Book
New Book
Links to me
On this page
Sponsors
Calendar
<April 2014>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
Archives
Tags
Blogroll OPML
Technorati
Favorite Links
Disclaimer

Powered by: newtelligence dasBlog 1.9.6264.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail