Navigation


Milos Solution Platform (External Blog)

The Milos Solution Platform is .NET's premier platform for building business applications. This blog is meant for developers who use or evaluate Milos. This blog is used to share tidbits of information provided by the Milos developers at EPS. Many of the posts put the spotlight on new features. We generally recommend that all Milos users (developers) at least scan this blog to keep up with the Milos news.

Content Area Footer

Thursday, April 10, 2008
Milos Web Development supports jQuery

Have you ever used jQuery? (www.jQuery.com). It is a very cool JavaScript library that makes all kinds of client-side HTML development much easier. The most recent version of Milos web control (ASP.NET) now use jQuery for internal stuff and it is also available for you to use in your own client-side efforts. Whenever you include SimpleWebControls.dll in one of your projects, you automatically get access to jQuery stuff. All you have to do is include a script reference, as well as the Milos resource HTTP handler in the web.config (which you should always have anyway). So the web.config needs to have this:

<httpHandlers>
    <!-- Other stuff here... -->
   
<add verb="*" path="Milos_simplewebcontrols_*.aspx"
        
type="EPS.Web.SimpleControls.ResourceRequestHandler,
               SimpleWebControls
"
/>
</
httpHandlers>

With this in place, you can simply add a <script> element to your page to get the jQuery features:

<script
  src="milos_simplewebcontrols_getresource.aspx?resourcetype=Script&resourcename=JQuery"
  type="text/javascript"></script>

Note: This aspx page does not really exist. Whenever this URL gets hit, Milos intercepts the call and returns a dynamically generated script stream to the client.

With this in place, you can now add jQuery stuff like this:

$(document).ready(function() {
    alert("Main document content loaded!");
});

For more information on jQuery syntax and features, visit www.jscript.com, or get one of the many jQuery books out there (the jQuery site lists several).

Note: Milos also uses jQuery features for some of its advanced scripting. For this reason, it could happen that the script reference gets included multiple times, which could lead to unexpected results. For that reason it is better to add the script reference in the Load() event of the page (or a control) using this code:

if (!Page.ClientScript.IsClientScriptIncludeRegistered("JQuery"))
{
  page.ClientScript.RegisterClientScriptInclude(
"JQuery"
   
"milos_simplewebcontrols_getresource.aspx?resourcetype=Script&resourcename=JQuery"
);
}

This automatically adds the script reference from above, but it only adds it if the reference isn't there already.

There is a lot of cool stuff that can be done with jQuery, from simplified event handling to relatively advanced (for HTML) visual effects. Milos uses this for a number of things, such as the cool new overlay dialogs. But that is a topic of a different post... :-)

  


Posted @ 1:03 PM by Egger, Markus (markus@code-magazine.com) -
Comments (8)




Comments:

RE: Milos Web Development supports jQuery
Wednesday, June 29, 2011 7:27 PM by vibram 5 fingers - cai297472630@126.com

Great job on the blog, it looks great. I am going to save it and will make sure to visit weekly


RE: Milos Web Development supports jQuery
Tuesday, November 08, 2011 6:47 PM by iPhone 4S Ringtone Maker - plant2013@gmail.com

iPhone 4S Ringtone Maker is the fastest and easiest way to create custom ringtones for your iPhone.


RE: Milos Web Development supports jQuery
Wednesday, November 16, 2011 12:58 AM by Asics Mexico Baja - wymgn-nmmgmail.com

A beautiful form is better than a beautiful face; a beautiful behavior than a beautiful form.


RE: Milos Web Development supports jQuery
Thursday, November 24, 2011 2:36 AM by car covers - purplelin17@hotmail.com

car covers for cheap


price of silver per ounce today
Tuesday, November 29, 2011 3:50 AM by avena bailey - avenabailey@gmail.com

Just got done reading the article and I have to say good. I agree with what you are saying and I will have to look further into this.


RE: Milos Web Development supports jQuery
Tuesday, November 29, 2011 3:51 AM by price of silver per ounce today - avenabailey@gmail.com

Just got done reading the article and I have to say good. I agree with what you are saying and I will have to look further into this.


RE: Milos Web Development supports jQuery
Saturday, December 03, 2011 7:16 PM by New Hampshire Wedding Venues - weddingnhham@gmail.com

Every topics of your blog is informative , i think it would be delightful if the administrator add some tutorial related to the topics.


Milos Web Development supports jQuery
Thursday, December 08, 2011 4:52 AM by Generic Amoxil - dollylandrya@yahoo.com

Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your web-site is greatly appreciated.




Post a Comment:

Comment Title (required)

Your Name (optional)

Your Email (optional)

Your Web Site (optional)

Your Comment (required)

 

 

 

 

 

 

 

Syndication RSS 2.0 RSS 2.0

All My Blogs:
My personal blogs:
Dev and Publishing Dev and Publishing
Travel and Internat. Living Travel and Internat. Living
Other blogs I contribute to:
Milos Blog (US) Milos Blog (US)
VFPConv. Dev Blog (US) VFPConv. Dev Blog (US)
VFPConv. Dev Blog (DE) VFPConv. Dev Blog (DE)

 

Blog Archives
All Blog Posts

2010
    November (1)
2009
    July (2)
    February (2)
    January (1)
2008
    December (1)
    October (3)
    June (1)
    April (3)
    February (1)
    January (1)
2007
    December (1)
    October (2)
    September (2)
    July (1)
    June (2)
    May (4)
    April (6)
    March (8)
    February (3)
    January (2)
2006
    December (2)
    November (2)

 

 

 

This Blog is powered by MilosTM Collaboration Components.