Thursday, September 22, 2011

Disable List Deletion using powershell sharepoint

PS > $spWeb = Get-SPWeb http://aaa.bbb.ccc
PS > $spList = $spWeb.Lists["Tasks"]
PS > $spList.AllowDeletion = $false
PS > $spList.Update()
PS > $spWeb.Dispose()

Tuesday, September 20, 2011

using resx file in asp.net

add new item to asp.net project "resource file"

enter name and value pair in this file

put this file in App_GlobalResources

use below code to access file

public string GetErrorString(string validationString)
{
return Convert.ToString(GetGlobalResourceObject("fileName", validationString), CultureInfo.InvariantCulture);

}

Friday, September 9, 2011

Change the Text message list View Sharepoint 2010

 

Before:
      image
After:
    image



<script  type="text/javascript">

function ChangeDiscussionMessage()
{

  var a = document.getElementsByTagName("TD");
  for ( var i=0; i<a.length; i++ )
  {
    if (a[i].className=="ms-vb")
    {
      if (a[i].innerHTML.indexOf("There are no items to show in this view")>-1 &&
          a[i].innerHTML.indexOf("discussion board")>-1)
      {
         a[i].innerHTML = "There are no active discussions";
      }
    }
  }
}

_spBodyOnLoadFunctionNames.push("ChangeDiscussionMessage"); 

</script>

 

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...