Monday, December 31, 2012
Wednesday, June 13, 2012
Calling page in div
<div class="ad">
<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:292px; height:255px;" src="http://yahoo.com">
</iframe>
</div>
<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border:none; overflow:hidden; width:292px; height:255px;" src="http://yahoo.com">
</iframe>
</div>
Wednesday, June 6, 2012
Sharepoint 2010 enable Datasheet view
To enable this feature. AccessDatabaseEngine.exe needs to be installed to users machine.
Create and map new user profile properties with LDAP
We have mapped a LDAP Employee ID property with Sharepoint 2010 user profile property.
1) Create a Sharepoint user profile property (EID)
2) Check the Forefront manager for LDAP property which needs to be mapped with Sharepoint user profile property using powershell command.
- Forefront manager path.
- Drive:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\UIShell)
- Click on the “Management Agents” tab
- There should be a management agent in the list that represents your synchronization connection. For Active Directory synchronization connections, the management agent will have the name MOSSAD-YourSynchConnectionName . Double click on the management agent that represents your synchronization connection
- Click on “Select Attributes”
- Select the “Show All” check box
- This should show you a list of all LDAP attributes that can be mapped to SharePoint managed properties. Remember that the $fimProperty variable in the script should have the exact same value as the attribute appears here. If the desired attribute is not in this list, the script will throw “Unable to process Put message” error.
3) Start and Stop the two services (User Profile Service and User Profile Synchronization Service
4) Run the below powershell command.
$url = http://migration:1111/ #URL of Central admin
$spsProperty = "EID" # Internal name of sharepoint user profile property
$fimProperty = "employeeID" #Name of the attribute of the LDAP
$connectionName = "User_Profile" #Name of the sharepoint synchronization connection
$site = Get-SPSite $url
$serviceContext = Get-SPServiceContext($site)
$upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)
$synchConnection = $upManager.ConnectionManager[$connectionName]
$synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
5) If Error comes restart the server and run the above powershell command again.
Sunday, March 25, 2012
How to set sharepoint 2010 Model popup on the centre of the page
Add below style on master page for complete site.
<style>.ms-dlgContent{position:fixed}</style>
Saturday, March 24, 2012
Set Default page for the all Sites/Subsite of the Site collection.
Set Default Page for All sites inside the Sitecollection
public static void SetPageAsDefult()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string strUrl = "http://MYSITE:1000/sites/project/";
using (SPSite oSiteCollection = new SPSite(strUrl))
{
string sitecollection = oSiteCollection.RootWeb.Title;
if (oSiteCollection != null)
{
foreach (SPWeb web in oSiteCollection.AllWebs)
{
SPFolder rootFolder = web.RootFolder;
rootFolder.WelcomePage = "pages/Home.aspx";
web.AllowUnsafeUpdates = true;
rootFolder.Update();
web.AllowUnsafeUpdates = false;
}
}
}
});
}
public static void SetPageAsDefult()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string strUrl = "http://MYSITE:1000/sites/project/";
using (SPSite oSiteCollection = new SPSite(strUrl))
{
string sitecollection = oSiteCollection.RootWeb.Title;
if (oSiteCollection != null)
{
foreach (SPWeb web in oSiteCollection.AllWebs)
{
SPFolder rootFolder = web.RootFolder;
rootFolder.WelcomePage = "pages/Home.aspx";
web.AllowUnsafeUpdates = true;
rootFolder.Update();
web.AllowUnsafeUpdates = false;
}
}
}
});
}
Set Master page for Publishing sites for publishing page
Change master page for Publlishing site .
SPSite curSite = new SPSite(http://MySERVER:1000/);
SPWeb objweb = curSite.OpenWeb(strWeb);
//Besure to check the path of the master page.
Uri masterUri = new Uri("http://MySERVER:1000/" + /_catalogs/masterpage/My_MasterPage_Blank_right_1.0.master");
objweb.CustomMasterUrl = masterUri.AbsolutePath;
objweb.AllowUnsafeUpdates = true;
objweb.Update();
objweb.AllowUnsafeUpdates = false;
Subscribe to:
Posts (Atom)
HTML
Script: