ClientScript

  • JavaScript for the masses

    As you may be aware Scott Hanselman’s 2009 Ultimate Developer and Power Users Tool List for Windows came out yesterday. If you are like me you end up pooling through the list especially the new stuff to see if there is something cool that somehow you missed. I found an item on the list that answers something I think I have been looking for (but not for me), but before I go on I need to give you some background (as usual). Kevin D. Wolf (aka ByteMaster) and I have been talking over the last several months on all things Ajax. We’re...

  • jQuery-UI visual studio intellisense (vsdoc) file

    If you’ve ever tried to use jQuery UI with Visual Studio, you’ve run into a JavaScript parse error and you lose JavaScript intellisense in Visual Studio. I wasn’t exactly sure of the issue until I read someone’s advice (who was just trying to get the datepicker working) to simply include a dummy jquery-datepicker-vsdoc.js file. So I did this for the jquery-ui.js file and lo and behold, no JavaScript parsing errors, and I had intellisense for everything EXCEPT jQuery UI. Anyway, I dug around and couldn’t find one… so I created the beginnings of one. What you get is very core level...

  • Better JavaScript class generation

    For years, I have been espousing how great Script# is. I often do an advanced MS ASP.NET Ajax client talk and end it with a Script# talk. Mainly because I think that the idea of learning the nuances of JavaScript OO techniques can be a little confusing. It’s really the challenge (All you need to do is search the archives of my blog and you’ll see my own confusion on this topic). I think many web developers can wrap their heads around building the functionality, but making something private/public/static can get a little confusing. Especially if you are used to using...

  • Using the Ajax control toolbox with jQuery (and ASP.NET MVC)

    [Here’s a preview of something I’m going to show Thursday night at the Tampa MVC group.] You may have thought that by jumping on ASP.NET MVC that you have to leave behind all the cool Ajax Control Toolbox controls.. or more than likely you realize that it’s possible to use them, but one has to be a “JavaScript Rocket Scientist” to use them.. It’s really not, but you do need a couple things to use them.. First of all go here (Bertrand Le Roy’s blog) and pick up the jQuery plugin that let’s you instantiate MS Ajax Behaviors. Next go here to...

  • clientscript as the view controller

    I’m finalizing my demos for next week’s talk at the Tampa ASP.NET MVC user group. I’m also in the midst of a deploy to our test servers of among other things a page that is an experimental architecture for me and my team. I was talking with my boss (Perry for those of you who attend Tampa UX). He had to do a little touch up on my quickly thrown together UI. He told me after playing with it that he really liked how it performs and even how it works. He thinks it’s a pretty good UX. It’s actually very...

  • The two ways one writes JavaScript code..

    I think sometimes in the past I have been guilty in my presentation on JavaScript (JS) of not defining for myself who my audience is. Actually I know that I’ve done a poor job of this. You see there are 2 ways to write JavaScript code. Something that I knew, but recently realized the importance of. OO Baby If you are building your own controls then you are all about building things in an OO manner because it helps you in the areas on manageability. You may or may not be testing your components with automated/unit test tools...

  • CodeRush/Refactor Pro refactors Javascript too

    I just saw an article talking about a new Ruby product from JetBrains. One of the side effects of this product is that they offer refactoring support for JS code. <yawn /> I had to chuckle a bit. I guess my love affair with the Developer Express’ Code Rush/Refactor Pro (CR/RP) addin continues to pay off… I’ve had refactorings for JavaScript AND HTML/ASP.NET markup for about a year (and they added it a long time ago). If you didn’t know that… now you do (they keep finding new places to add refactorings… it seems like nearly every file in your...

  • Client-side Scripting 101 Part 2: JavaScript OOP Basics

    [Sorry this took so long to get out… I have been distracted by Windows 7 and am working between 2 OS’ on 1 machine… Win7 is now my primary OS and I didn’t have this post here… that and I’m now twittering doesn’t help either] Ok, since in the first version of my last article I referenced the "prototype" property, it felt natural to begin by talking about JavaScript OOP basics. Now, I’m not going to try to define all the terms that usually get associated with the type of OOP used in JavaScript ("JS" hereafter). I want to...

  • Client-side Scripting 101 Part 1: The Reasons

    [Welcome to my multi-part tutorial on. I know I did an introduction earlier in the month, but before we dig in deep into this I thought it would be good to get a few questions out of the way.] Why is this (Client-side Scripting) all that important to me? You may be thinking "Hey Jay, my company bought Telerik/Component Arts/Component One/{fill in some other ASP.NET tools suite} and it seems to do everything I need and more. I can see some places where a little client-side code is helpful, but it’s not that important, is it?" Well, I’m definitely not one to...

  • C# Style Attributes in Script#/Javascript

    [If you aren’t knee deep into Script# or JavaScript this post might not make any sense. If you are into BDD (or TDD) you might want to read further to see some ideas I’m playing with. If you write TDD tools for running tests... please read further... ] [NOTE (For Joe Only): Joe, yes, this is a "shiny stuff" post; some day it might have a practical use at which point I’ll write a non-alpha geek version of this post which will be a tutorial of how to use this to make your life easier.] One of the things I’ve been looking...

  • Script# - Literal feature... How did I miss this one?

    Today, I’m doing some work with Script# and I ran into the one thing about Script# that I don’t like: there are a few areas where Script# just isn’t able to perform some task. This happens a lot when you are developing Atlas (MS Ajax) components instead of using Nikhil’s ScriptFX client library. Today I ran into one of those areas. Specifically I needed to dynamically add/remove options from a select element. In JS this is a breeze for me, but Script#'s SelectElement’s options array is defined as a dictionary which doesn’t allow for adding elements. In the process of...

  • Tampa Code Camp 2008 Wrap up

    Yesterday I had an excellent day at the Tampa Code Camp. My wife gave me a vacation day from the family (thank you!) which makes for a good day that I can just hang out catch a couple sessions, speak, and connect with a few other geeks. I have attached my slides and sample projects to this post (the sample solution requires that you have Script# installed). I also attached my MS Ajax Cheat sheets as well. Normally that would be all that I would put up here, but there were some additional things that happened as a...

  • Core Addin Challenge: 2 weeks with CodeRush/Refactor Pro (CR/R!)

    [As previously mentioned I have committed to switching from ReSharper (R#) to CR/R!... the end result will be a regular guy’s comparison of the 2.  DISCLAIMER: By no means is this meant to be a slight on R#, but more of me looking at CR/R! a little closer -- I think a number of us took a cursory look at CR/R! and while we found value a surface look doesn’t really give you the full picture... I’m going through the challenges of using CR/R! because it IS different from R# and hopefully I can help folks who are trying to...

  • DLRScript 0.55 released for Silverlight2 Beta2

    [UPDATE: I forgot to add the link to the project - http://www.codeplex.com/dlrscript/] It took a bit of time for this release. In the end I had to take everything a step back (as well as there are probably a few "mid thoughts" in here as the release of SL2 Beta 2 caught me a bit by surprise... actually the changes to the DLR caught me more by surprise). The step back is that we no longer get script code lines when there are issues. I’ll try to bring this feature back, but right now if it breaks, you’ll know it via an...

  • MS MVC Thoughts

    [NOTE: I haven’t quite had much of a chance to look at the new Preview 4, so take this as someone nearly informed. I haven’t read about anything in the Preview 4 that changes what I’m going to say. Also, remember that I am the admin/editor of the blog site which is Alt Alt.NET... so testability/mockabilty doesn’t really resonate with me.] I know it’s shocking that I would have something to weigh in on MS MVC, but I do. For those who don’t know. I took some issue with Ayende’s "leaky abstraction" back in my CodeBetter days (they had...

  • Tampa User eXperience (TUX) User Group is coming September 10th, 2008…

    I am proud to announce that I and a couple other guys are starting User Group that revolves around User Experience (or UX) in the MS tools eco-system. The other guys are Shawn Cady, Perry Panagopoulos, and Bill Reiss (MVP) [Bill always gets his MVP props]. I could give you all their backgrounds, but I’ll make them do it at the first meeting. I’m sure Papa Fish (aka www.devfish.net) the local MS Dev Evangelist (my Blog Father) Joe Healy will be around (at least for the first meeting). TUX' Focus Our focus will be on the "now" of Ajax and how it...

  • Cool ScriptManager stuff I missed...

    So the last week or so I have been doing some heavy handed UpdatePanel development (stuff where I needed to fix an existing form that needs help to support an UpdatePanel or stuff where I needed to do something special while the page was posting back asyncronously). In the midst I discovered some cool mechanisms that I missed! For instance you can determine whether the current request is an async request by doing something like this: 1: ScriptManager sm = ScriptManager.GetCurrent(Page); 2: if (sm != null && sm.IsInAsyncPostBack) 3: { 4: ...

  • Script#: Events/Delegates in an Atlas/MS Ajax style script

    First of all if you don’t know what Script# is, it is a C# language variant available in VS2005/2008. The difference is that it can be used to create JavaScript. The compiler produces an assembly (usable in other Script# projects) and a set of JS files (a release and a debug version). Nikhil Kothari (the author) also has 2 script frameworks you can target: Nikhil’s framework, and the "Atlas"/MS Ajax (aka MS ASP.NET Ajax) framework. There are difference in what you can do when using the "Atlas" framework. Event Limitations Let me start with a quote...

  • Composition vs. Inheritance...

    [I really should stay out of these discussions... I really should, but I can’t resist.] The other day I saw an article on Composition over Inheritance (I forget where I saw it). The article did a good job of explaining what "composition" is. This is my simplistic understanding (which means that someone will probably come in and tell me I have it ALL wrong... what else is new?): "composition" means essentially wrapping objects instead of direct inheritance (so instead of inheriting from X you instead have a private instance of X in your class that you use, but you...

  • DLRScript update

    I have begun working on DLRJScript-JavaScript compatibility. I was actually successful running my first externally created JavaScript -- EcmaUnit 0.4 (which is a small JS testing framework). I did have to make a couple modifications. I’m becoming aware of the size of this job though. I’m currently porting a Mozilla-compatible XmlHttpRequest object which I think will work with all the major Ajax frameworks. I’m not sure which Ajax Framework I’ll actually target as the first on to run. I could stick with the man and make it work with the MS Ajax client library, I could go with Prototype that so...

  • DLRScript 0.5 Notes...

    As you may or may not have seen, over the weekend I released a new version of my DLRScript project.  It’s coming along. It adds 3 things: File loading via the src attribute, better exception reporting for DLRJScript(it shows you what line of script code failed), and improved DLRJScript performance. File Loading I could probably write a bunch on this (and probably should in another article). Basically I am dynamically loading content (script files) from the server. I also extended HTML a bit in that you can now use the same script tag to load...