Ajaxhttp://www.geekzilla.co.uk/Innovation Team's dumping grounden-usTue, 10 Jun 2003 04:00:00 GMTTue, 10 Jun 2003 09:41:01 GMTGeekZilla.co.ukeditor@GeekZilla.co.ukwebmaster@GeekZilla.co.uk Programmatically registering a client script in the ScriptManager http://www.geekzilla.co.uk/view5E04A005-240D-40DD-A51D-9E3DEB62862E.htm Programmatically registering a client script in the ScriptManager Registering a client script in the ScriptManager is easy! 11/7/2007 http://www.geekzilla.co.uk/view5E04A005-240D-40DD-A51D-9E3DEB62862E.htm Calling a static "page method" from Javascript using MS AJAX http://www.geekzilla.co.uk/view7B75C93E-C8C9-4576-972B-2C3138DFC671.htm Calling a static "page method" from Javascript using MS AJAX Atlas gave us the ability to easily call Web Services from JavaScript. MS AJAX has gone one step further! We can now call methods in the codebehine of the current page from Javascript. Here's how: '''This is designed for v1.0.61025.0 of AJAXExtensionsToolbox.dll''' Enable Page Methods on your ScriptManager Set the '''EnablePageMethods''' attribute to true Mark your method as static and give it the WebMethod attribute The method has to be declared '''static'''. It must also be marked with the WebMethod attribute. You'll probably find that you need to include System.Web.Services Call it from Javascript To call the method from javascript you need to append PageMethods. to the front of the method name. 11/7/2007 http://www.geekzilla.co.uk/view7B75C93E-C8C9-4576-972B-2C3138DFC671.htm Launching an Ajax ModalPopupExtender from JavaScript http://www.geekzilla.co.uk/view38736C2B-BAD3-418A-A5B0-DAC4F1A5A83A.htm Launching an Ajax ModalPopupExtender from JavaScript This is an updated version of the earlier (and very popular) {Atlas article}http://www.geekzilla.co.uk/ViewDAAE6AAB-0369-45C2-BE78-B8E6F876B4F4.htm It is by far the simplest way to launch an Ajax ModalPopupExtender from javascript. The groundworks Add a hidden link for ModalPopup Extender to attach to('''which will NEVER be used''') Add the ID of the hidden link to the ModalPopupExtender Showing the modal popup Now you've done this, in Javascript, you can display the modal quite easily... here's how. Hiding the modal popup Just as easy... #c#$find('MyMPE').hide(); 10/7/2007 http://www.geekzilla.co.uk/view38736C2B-BAD3-418A-A5B0-DAC4F1A5A83A.htm Lightweight Ajax http://www.geekzilla.co.uk/viewC77497B2-2CD6-4FBC-968C-93AFF2F397EB.htm Lightweight Ajax Ajax doesn't have to be complicated - at its most basic it just means partial updates your pages rather than reloading the whole page. The attached js library contains just two functions - GetContent and RunJS. GetContent() takes a URL and a element name: It simply populates the elements innerHTML with whatever the URL returns. Optionally you can also specify to append to the div content rather than repalce. Run() takes a URL only: It simply runs whatever the URL returns. The simple example below shows how these can be used to create rich interface such as a node tree. The source for this is attached as a zip file below, but I'll summarsie here; The Default.aspx page references the Ajax.js file and contains a function init() that adds a few nodes. The variable 'node' is just a unique reference for each div - note that the GetContent() calls reference myDiv, myDiv1 etc. The Node.aspx file is pretty simple also; It just contains another <DIV> element and link to populate it, again using the GetContent() function. Because of the simplicity of the functions, integrating with other tools such as Rico is not complex. This is not a replacement for a framework such as ATLAS, but it is a lot easier to pick up if you just want to Ajax enable key functions in your existing application. 27/8/2006 http://www.geekzilla.co.uk/viewC77497B2-2CD6-4FBC-968C-93AFF2F397EB.htm