Contents tagged with AJAX
To use minified JavaScrips (or CSS files) in your SharePoint 2010 solutions you can do it easy with the Microsoft Ajax Minifier 4.0 and a pre-build event in Visual Studio 2010. Just follow these simple steps when you have installed the Minifier.
"C:\Program Files (x86)\Microsoft\Microsoft Ajax Minifier 4\ajaxmin.exe" -JS $(ProjectDir)\Layouts\Wictor.Minified\TheScript.debug.js -out $(ProjectDir)\Layouts\Wictor.Minified\TheScript.js -CLOBBER
Then add a Visual Web Part to your project and add code as follows:
<SharePoint:ScriptLink runat="server" Name="Wictor.Minified/TheScript.js" Localizable="false"/> <asp:Button runat="server" Text="Click me!" OnClientClick="thisIsMyFunction('Hello mini!');" />
Make sure that your SharePoint web application does not have debugging configured in the web.config and hit Ctrl-F5. This will start Internet Explorer and you can add the Web Part to a page. Then take a look at the source and look for your script. It should look something like this.
Then hit F5 to run the project in debug mode and inspect the source of the page. You can now see that the debug version is loaded.
That's it! Simple! Now go on minifying!
Here is a list of cheat sheets for the Windows and .NET platform that I frequently use and I think are of great interest.
Visual Studio 2005 Keyboard Shortcut References
- Visual C# 2005 - PDF grayscale | PDF color
- Visual C++ 2005 - PDF grayscale | PDF color
- Visual Basic 2005 - PDF grayscale | PDF color
SharePoint and Office stuff
- CSS Reference Chart for SharePoint 2007 (Microsoft Office SharePoint Server 2007 and Windows SharePoint Services v3)
- CSS Reference Chart for SharePoint 2003
- New Office 2007 User Interface - Word | PDF
Web and ASP.NET stuff
Here's a summary from Scott's blog:
We have been doing a lot of work, on our product, with dynamic updates of web pages - you know the AJAX stuff. Most of the server side results are returned as XML and are delivered from different Web Services. Since I really like optimizations and like good and nice looking code I have been going back and forth in decision of how to return data to the client; XML or JSON. JSON are in some cases more effective but when the object model it tries to represent gets more complex you neither get nice looking code nor saves that much bytes.
The XML Reference Guide is a great site containing everything you need to know on XML standards, from the Document Object Model to RSS to AJAX.
Each topic contains in-depth descriptions and samples wich allows you to easily read up on a technology or just have it as a reference whenever you need to.
Bookmark this and save for future use.
Microsoft has release the first public release of the Windows Live Gadgets SDK, you can find it MicrosoftGadgets.com. You can also find the Gadgets Development Overview for Microsoft Sidebar for Windows Vista Beta 2 on the site.
Developing Gadgets for both live.com and Microsoft Sidebar will be really easy and fun. But I see a problem with only having live.com as the only web-based Gadget host (host meaning where the Gadget can execute). I would like to see an implementation in either Microsoft SharePoint Services or as a standalone product, so you can host Gadgets in an Intranet scenario. There are some examples on how to host your own Gadgets; for example Donovan West has an example using an iframe solution. The problem is still that the Gadgets are hosted externally which is not that great if you think about security issues.
Do you know of any other solutions or implementations of web-based Gadget hostings?