Posts

Showing posts from 2013

Validation for Asp FileUpload Control using JavaScript

function validatefileuploadcontrol() { $( $( 'input[id*="FileUpload1"]' )).change( function () { var fileExtension = [ 'doc' , 'docx' ]; //Extensions if ($.inArray($( this ).val().split( '.' ).pop().toLowerCase(), fileExtension) == - 1 ) { alert( "'.doc', '.docx' formats are allowed." ); } }) }

SharePoint 2010: JavaScript Code To Check if user exists in a group (ECMA)

//Call this function where you want IsCurrentUserMemberOfGroup( "GropuName" , function (isCurrentUserInGroup) { if (!isCurrentUserInGroup) { } }); //Below is the Function to Check whether the user exists in the group or not function IsCurrentUserMemberOfGroup(strGroupName, functionComplete) { //Setup Vars currentContext = null ; currentWeb = null ; allGroups = null ; leaderGroup = null ; currentUser = null ; groupUsers = null ; //Get an instance of the Client Content. currentContext = new SP.ClientContext.get_current(); //Grab the client web object. currentWeb = currentContext.get_web(); //Get the current user object currentUser = currentContext.get_web().get_currentUser(); currentContext.load(currentUse...

Delete Sharepoint List Using PowerShell

$web = get-spweb -Identity http://sp2010 $list = $web.lists["corrupted list name"] $list.AllowDeletion = $true $list.Update() $list.Delete()