Posts

Right way to add CSS and JavaScript to SharePoint App Pages and Master-Pages

In SharePoint-Hosted App, there is a special way to embed your JavaScript and CSS. Adding JavaScript: To add JavaScript that resides in the "layouts\15" folder, just specify the file name: < SharePoint:ScriptLink name=" sp.core.js " runat="server" LoadAfterUI="true" Localizable="false" /> To Add JavaScript that resides in your app, for example in "Scripts" folder of your SharePoint-Hosted App: <SharePoint:ScriptLink name=" ~site/Scripts/App.js " runat="server" OnDemand="false" LoadAfterUI="true" Localizable="false"></SharePoint:ScriptLink> Adding CSS: To add CSS to a SharePoint-Hosted App, you need to know how SharePoint works, its a bit different form that way JavaScript is embedded in the app. Initially I thought, I could use "<SharePoint:CssLink" just the way I used "<SharePoint:ScriptLink", but it wasn't true. Sha

Knockout binding in SharePoint 2013 SharePoint-Hosted App

Today I was trying to make Knockoutjs work with SharePoint Hosted Apps in a way that is manageable and extensible. I assume you already know Knockout JS and know how to create a basic SharePoint-Hosted App. There can be many ways using which KO can be plugged into an application but here here is what I think would work well for SharePoint-Hosted Apps considering async JSOM calls: Step1: Add Knockout JS Just download the js file and paste inside the Scripts folder. Refer it in your Default.aspx page. Step2: Add html binding In the Default.aspx page of SharePoint 2013 Hosted put the following code in the "<p id="message">" tag: Welcome <span data-bind="text: username"></span> Step3: Apply KO Bindings At the bottom of the Default.aspx page put the following code:     <script >         var viewModel = new window.MyApp.ViewModel();         viewModel.load();         ko.applyBindings(viewModel);     </script> Step4: Y

SharePoint 2013 Online and ASP.NET Web API using JSONP

Consider a scenario where you have to display data or make decisions on a SharePoint 2013 page based on the data that exists in a database. Here is what you can do: Abstract: 1. Create an Empty ASP.NET Web API project. 2. Enable the project for JSONP format 3. Add the Controller, Model, the business and data access logic to the service 4. Deploy the Service 5. Add script to SharePoint 2013 page Details: 1. Create an Empty ASP.NET Web API project. This is fairly simple step, all you need is MVC4 or above and .NET Framework 4.5. Using Visual Studio 2012/2013, Add new project, select an empty project and check the Web API box and click OK. 2. Enable the project for JSONP format: - Open package manager in visual studio (Tools&gt;NuGet Package Manager &gt; Package Manager Console and run the following command, it will add the required dlls to your project: Install-Package WebApiContrib.Formatting.Jsonp - In App_Start folder of the project, create a new class:  

Future of Hard-Disk Drives?

All tape drives of the past and most recent high capacity drives used today after all are magnetic drives (which use "ferromagnets" to store bits). Then Solid State Drives (SSDs) gave a new direction of fastest drives. I think that's the future of hard-drives for another 5 years. However, what if we had a mixture of two? The real future of storage I think will be storage using atomic structures with an addressing scheme and algorithm of an SSD and a four-atom-wide wires. Instead of flip-flops, "antiferromagnets" will be used and result will be lightening fast drives with thousands of TB of storage... ? Read about flip-flop replacement: Tiny hard drive stores one byte of data with just 12 atoms About connecting-wire replacement: Four-atom-wide wire may herald tiny computers I am ready to buy that drive as soon as it becomes available ;)

Microsoft Visual Studio Useful Shortcuts

Here is a link where Visual Studio shortcuts are available which can make you efficient developer if you make good use of them… http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

IE 6 is ending in January 2012

So Microsoft has planned to give a new year present by forcefully pushing IE6 to the next world. They have decided to upgrade everyone's browser to maintain a minimum version. Read more here: IE to Start Automatic Upgrades across Windows XP, Windows Vista, and Windows 7

SQL Server Management Studio 2008 (SSMS) - Intellisense is not working

The SSMS intellisense wasn't working for me when we migrated our database server from 2005 to 2008. Here is what I used and its working for me pretty well. http://www.devart.com/dbforge/sql/sqlcomplete/download.html Install the Express version of it and it does the job!