Thursday, 29 January 2015

Script Manager in C#

ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('Your Message Here !!!');", true);

Wednesday, 7 January 2015

Get List Item Count in SPServices

completefunc: function (xData, Status) {
 var ItemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
}

Get library Folder Items using SPServices



$().SPServices({
 operation: "GetListItems",
 async: false,
 listName: "YOURLIBRARY",
 CAMLQueryOptions: '<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>',
 completefunc: function (xData, Status) {                       
        $(xData.responseXML).find("z\\:row, row").each(function () {
     var photo  = $(this).attr("ows_RequiredField");
                });
        }
});

Tuesday, 30 December 2014

Modal Dialog Pop-up in SharePoint

Open Model Dialog:
function ModalDialo() {          
        var options = {
            title: "Your Title",
            width: 850,
            height: 650,
            showClose: true,
            url: "/_Layouts/15/Example.aspx",
        };
        options.dialogReturnValueCallback = Function.createDelegate(null, scallback);
        SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);      
        return false;
    }
Close pop-up post back the parent page:  
        function scallback(dialogResult, returnValue) {
            window.location.reload(true);
            if (dialogResult == SP.UI.DialogResult.OK) {
                window.location.reload(true);
            }
        }

Thursday, 11 December 2014

Find SP in SQL Server

use YourDatabaseName;
GO
sp_helptext 'YourSchemaName.YourProcedureName'