.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Programmatically changing the 'Activities I am following' under Newsfeed Settings

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :SharePoint
Hi, is it possible to programatically select/deselect activities I am following on the news feed preferences page under MySites? I want to be able switch on/off notifications for both custom events and those provided by Sharepoint 2010 out-of-the-box.

View Complete Post

More Related Resource Links

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

Programmatically Changing the Profile Provider at Runtime


Dear All

I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.

This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:

Dim RolePV As RoleProvider = Roles.Providers(GetSettingFromFile("Provider"))

However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.

Please can you help me to understand how I access the profile property called ScreenSize by dynamically setting the profile provider first?

I'd be very grateful for any help or advice.

Many thanks



Programmatically Hide Master Pages from Site Master Page Settings page?



I know there is a field you can check when you edit the properties of a Master Page in the Master Page Gallery to set a Master Page to hidden but ... can anyone think of a way to programmatically hide specific Master Pages from the Site Master Page Settings page?

Maybe this should be two questions:

  1. How do I programmatically access a Master Page in a Master Page Gallery?
  2. Is there a property that can be set that will hide the page from the Site Master Page Settings page?

Setting language settings programmatically MUI?!

Is it possible to set the language settings programmatically ?? Site settings > site administration > language settings and next programmatically select the installed language packs?

Programmatically remove IIS HTTP header settings

 Our IIS server (v7) has the following settings in [Custom HTTP Headers] for our whole site: Pragma: no-cacheCache-Control: private, no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0X-Powered-By: ASP.NET Out of the whole site, there are some pages that require the "no cache" setting to be removed for them to work properly. This was done manually by our IIS Administrator until recently.  Now we were told that we need to do it programmatically on our end. The following were the code snippets (VB.NET) we have used with no luck in success. Advice is appreciated, Thanks! Method-1Response.Headers.Remove("Pragma")Response.Headers.Remove("Cache-Control")Response.Headers.Add("Cache-Control", "private")Response.CacheControl = System.Web.HttpCacheability.public Method-2Response.ClearHeaders()Response.Headers.Clear()Response.CacheControl = "Public"Response.Cache.SetCacheability(HttpCacheability.Public)Response.Cache.SetAllowResponseInBrowserHistory(True)

Newsfeed settings section deleted


Hi, I have accidentally deleted the group "Newsfeed settings" section from the user properties page in the User Profile Service Application. The bad news is that this section contains all the personal settings for newsfeed. Is there a way to recreare it?

The operations I have done are:

  1. Create a new sub-type
  2. Assign the Newsfeed settings section ONLY to the new sub-type
  3. Delete the new sub-type

and voilà, Newsfeed settings has been deleted.

Thank you

How programmatically change Additional Column Settings - Show field?


Hello. I use the SPFieldUser in my list. I can change Additional Column Settings - Show field: "Name with Presense" on the "Name (with Picture and details)" using the WSS Web interface. How do it programmatically, using Object Model WSS?

Programmatically changing DispForm.aspx



I've got some code setup which alters the DispForm.aspx page for a list. It gets a web part manager instance, deletes all webparts (the default listview one) and inserts a custom webpart.

The code seems to work, but for some reason; the file disappears after it's changed. I can't see it any more in SharePoint designer, and the DefaultDisplayFormUrl property of the list suddenly becomes null.

What's the proper way of programmatically changing DispForm.aspx without messing up the list instance?

MCTS in Web Application Development in .NET 2.0

Changing Z-index order programmatically in C# with Control.SetChildIndex?

Hello developers.

I've recently build a Windows form app that contains 18 pictureboxes and 1 button.
I want the boxes on the bottom of the form to be on the front, so they overlap all the others.
And the boxes on the top of the form must be on the back, so they are behind all the others.

I can manually do this with 'move to front' and 'send to back' options, but I want to to this programmatically.
This is so, because I'm gonna add another picturebox that can move.
That picturebox should automaticly change it's z-index when it's Y changes.

At the moment the 17 pictureboxes have a random 'z order':
Some pictureboxes are on top, some are on the bottom, in a random way.
Now I want to set the z order correctly when I click on the button.

I've made code that sets the ChildIndex between 1 and 5 depending on the Y of the picturebox.
When the Y = 0, the ChildIndex will be 5, and when the Y = 400, the ChildIndex will be 0.
The pbBackground is also a picturebox, and this one's ChildIndex = 10.

My problem is, that my Windows form app isn't doing what it's supposed to be.

The picturebox names are pictureBox0, pictu

Changing AD domain name and keep SharePoint 2010 settings



I currently have a single server with SharePoint  which is inside the aaa.org domain. Due to business requirements they need to change the domain to bbb.org. The main problem that I have is that I need to replace the aaa.org domain which is basically stop it completely and start the bbb.org domain and migrate all users to this domain.

All the settings in SharePoint when installing it, I used users from the aaa.org domain can I change this before the bbb.org domain goes live? What would be the easiest way to "migrate" the users in SharePoint to point to the new domain? 

Thank you very much. I don't have too much experience with SharePoint and I need to have a better idea on it before I change anything else.



Site Settings page empty-blank, Site Actions not clickable in custom site created programmatically f



We are migrating from MOSS 2007 to SharePoint 2010 and testing custom code used for creating sites. Sites were used to be created based on a site template, 'STP' file. In 2010, there are no more 'STP' files, instead 'WSP' solution packages are used, so we created a new WSP site template in Solutions gallery. The custom code uses that WSP for creating sites now.

But, when a site is created, and when you go to Site Settings from Site Actions menu, it load empty page - no any settings links or anything, just a blank page (/_layouts/settings.aspx). Also, Site Actions menu becomes unclickable.

Has anybody seen something like this?

Thanks a lot!


Regards, R.D.M.

Programmatically changing a merge replication agent job


Is there a supported way to change a merge replication agent job programmatically?  I know how I can do it in SSMS, but I would like to be able to script it.  I basically want to do the following:

  1. Change a replication job from uni-directional merge replication to bi-directional merge replication by removing "-EXCHANGETYPE 1" from the agent command
  2. Reinitialize the subscription tied to the replication job
  3. Wait some period of time for the merge replication job to start running again
  4. Change the replication job back from bi-direction merge replication to uni-directional merge replication by adding "-EXCHANGETYPE 1" from the agent command



Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend