Wednesday, September 10, 2008

Put page in edit mode

Place this in the address bar and execute it:

javascript:MSOLayout_ToggleLayoutMode()

-shared by ppl at work

Tuesday, March 25, 2008

Access Denied on AudienceGlobal.CanAccess()

So I'm using the AudienceManager's GetAudience() and it blows access denied error, even when using RunWithElevatedPrivileges. I spent time looking for the root of the problem and as far as I can get is "AudienceGlobal.CanAccess(this.m_serverContext);"
which is the first line of code in the GetAudience method.

This is all withen: Microsoft.Office.Server.Audience.AudienceManager.GetAudience

I found one other reference on the web linked here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2978930&SiteID=1

The solution provided is a work-around and I was able to use it.

foreach (Microsoft.Office.Server.Audience.Audience objAudience in audienceManager.Audiences)
{
if (objAudience != null && objAudience.AudienceName == audienceName)
{
//use objAudience just as if you had called GetAudience
}
}

Wednesday, January 16, 2008

No delete button for site column

Yeah, I ran into this. I found a way to let you get more details as to why.

Assuming you are on the edit column page, put this in the URL Address box

javascript:DoDelete()

You should get an alert with some details.

Thursday, November 15, 2007

What's a database?

My wife asked that tonight. She liked how I explained it.

"A database is like a file cabinet. The drawers in the file cabinet are the tables. The folders in the drawers are the records/rows. The papers in the folders are the fields. The fields contain the data."

Make sense?

Saturday, October 27, 2007

MakeCab not updating wsp with updated DLL

Add this to the Pre-build event of your projects. With that bug we've come accross, this seems to take care of it for now.

cd $(TargetDir)
del $(TargetFileName) /q

Saturday, October 20, 2007

My Colleagues Footer Links

Our client wanted those two links under the My Colleagues webpart gone. I added the following javascript to the bottom of my page.

<script language="javascript">
//Grab the tbody of the table
var tbody = document.getElementById("SPS_CLMICSRCHRES").childNodes[0];
if(tbody != null)
{
//Count the rows
var rowCount = tbody.childNodes.length;

//Hide the rows we don't want
tbody.childNodes[rowCount-1].style.display = "none";
tbody.childNodes[rowCount-2].style.display = "none";
tbody.childNodes[rowCount-3].style.display = "none";
tbody.childNodes[rowCount-4].style.display = "none";
tbody.childNodes[rowCount-5].style.display = "none";

//Hide the top row
var headerRow = document.getElementById("tr_updcoll");
if(headerRow != null)
headerRow.style.display = "none";
}
</script>
Couldn't find a better way of doing it. MS didn't provide an option to turn them off. Didn't add an ID to them either.

Monday, September 17, 2007

Hide Site Actions Link

We don't visitors to our site to show the link so I just wrap the control using this control:

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="BrowseDirectories">

Site Actions

</Sharepoint:SPSecurityTrimmedControl>

The "BrowseDirectories" works for all the roles but Visitor. So it will hide the link for the Visitor role.