Nov 30

I’d like to apologize for the lack of posts lately…no, I haven’t given up in my Silverlight series, but I’ve been busy updating my existing ASP.NET book to the 4.0 version. It seems like I will have a lot of work (much more than I had anticipated, but the truth is that I really enjoy writing about technical stuff) so the Silverlight series won’t really go as fast as the one on MS AJAX…sorry for that…now back to business :,,)

I really didn’t gave it any thoughts until I spoke with a friend who he asked me about the options we have for requiring a script (when using MS AJAX, of course!). So, lets see…we can specify it by:

  • using the scripts object : Sys.scripts.Core loads the basic MS AJAX JavaScript file
  • using the components object: Sys.components.dataView loads all the JavaScript files required for using the DataView component;
  • using the plugins object: Sys.plugins.bind will load all the JavaScript file required for using the bind method;
  • name: “History” will load all the scripts required for supporting the history feature.

All of them requires that you “define” your scripts in a JavaScript file which must be included in the page after the start.js file. And the best thing is that you can mix them all when using the Sys.required method. Fantastic, right?

5 comments so far

  1. william apken
    2:41 am - 12-2-2009

    I know very little about silverlight as you can tell from my questions.

    Is it run on the client side?

    Can it interact with MS Ajax?

    Can you .load() xaml files like you can .htm files for dynamic switching of content?

    Does the last question even make sense?

    Thank You.

  2. luisabreu
    8:56 am - 12-2-2009

    to run silverlight, you need to install a plugin (similar to what happens with flash).

    yes, you can interact with JS and with the page DOM

    yes, you can load other xaml files but what you want might be achieved through silverlight user controls

    the advantage of using silverlight is that now you have a way to develop C# apps which are cross-platform!

  3. william apken
    2:04 pm - 12-2-2009

    That is very interesting.

    I”m working from a SPI (Single Page Interface) point of design. As I have stated a few times, I want my user”s experience to be close to a desktop feel for the user. With the elimination of postbacks. I have this working with a test site of around 20 pages.

    MS Ajax has made this thought become more of a reality that any framework that I have tried up to this point.

    Given that background. It does seem from your answers that maybe silverlight will fit in this pattern.

    From the little I have read. It seems like you need to create a Silverlight project from within VS 2010.

    It is possible to use silverlight from just a normal .html page (once you embed the silverlight.js file) or you must create a silverlight application?

    Do you have any suggestions on resources that address design issues with silverlight and js?

    Or even a simple example on where you have a silverlight object defined in an external file and when a user request (say a form) you load that silverlight object and insert it into the current page with no postbacks?

    Luis, I thank you many times over. I put questions out on forums and have written some of the people working on MS Ajax. With out a doubt you have helped me more than any other.

  4. luisabreu
    2:18 pm - 12-2-2009

    You can create SL projects from within VS 2008 and vs 2010: you just need to install de sdk and that”s it.

    Using silverlight means you”ll need:
    1.) SL project: contains your SL code. you can have several user controls (think of user control as the equivalent of a page in and c# code. you can have an UI where you have a main shell and several other user controls which represent the views of your app
    2.) web project which hosts your silverlight app

    notice that silverlight apps need a plugin to run (just like flash) and that means you”ll always need to have page that hosts it (btw, SL 3 supports out-of-browser instances and SL4 will remove several of the current restrictions – that”s why I said this is MS first real attempt to develop in cross-browser fashion).

    and yes, you can do what you want with a single page that hosts your SL app (wchih has several views) without postbacks…

  5. bad credit loans
    8:23 am - 12-30-2009

    Good Day!!! is one of the most excellent resourceful websites of its kind. I take advantage of reading it every day. rocks!