Sunday, December 14, 2008

Sharepoint Price Calculator

http://community.bamboosolutions.com/blogs/sharepoint-price-calculator/default.aspx

Saturday, December 6, 2008

Create SharePoint Alerts Programmatically

Using following code you can create alerts

SPUser user = mySite.Users["domain\user"];
SPAlert newAlert = user.Alerts.Add();
newAlert.Title = list.Title;
newAlert.AlertType = SPAlertType.List;
newAlert.List = list;
newAlert.Properties["eventtypeindex"] = "1";
newAlert.AlertFrequency = SPAlertFrequency.Immediate;
newAlert.Update(false);
 
If you want to set an alert for a list, you have to set the AlertType property to SPAlertType.List and set the List property to an instance of the SPList class.
 
If you want to set an alert for a list item, you have to set the AlertType property to SPAlertType.Item and set the Item property to an instance of the SPListItem class, in that your code should be
 
newAlert.AlertType = SPAlertType.Item;
newAlert.Item = item;
 
You can change following codes depending on what action you want to set alert using "eventtypeindex"
 
all = 0
added = 1
modify = 2
deleted = 3
web discussions = 4

If you want to send Alert daily you can change the AlertFrequency as mentioned below

newAlert.AlertFrequency = SPAlertFrequency.Daily;
newAlert.AlertTime = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 8, 0, 0);

If you are subscribing alerts for some other user, you should be the administrator or should have permisssions to manage alerts thne add your code with following code

SPSecurity.RunWithElevatedPrevilages(delegate()
{

web.AllowUnSafeUpdates=true;
  // Add your code here
});

Friday, October 24, 2008

I am a Microsoft Certified Technology Specialist in MOSS

Today I passed another exam i.e. Microsoft Office SharePoint Server 2007, Application Development exam.






The exam 70-542 were max 80 minutes long and there were 40 questions.
I felt very bad prepared, but I guess that something must had stuck since there were so many lucky guesses :-). I didn’t find it easy at all.

Last time I had a feeling of “knowing the stuff”. This time the feeling was more like “familiar stuff”.

Wednesday, October 1, 2008

Passed Microsoft Office SharePoint Server 2007, Configuration.

Today I passed the Microsoft Office SharePoint Server 2007, Configuration.


Monday, July 28, 2008

Code blocks are not allowed in this file.

By adding some inline code in a masterpage or pagelayout files or newform/editform/dispforn, you get the following error message:

An error occurred during the processing of xxxx.aspx. Code blocks are not allowed in this file.

It is basically a securiry warning which need to add an exception to the file to allow code to be run in the aspx.To get this working you need to modify the web.config of your web application. For instance, if you want to allow server side script on pages from the masterpage & pagelayout gallery you have to modify the PageParserPaths into:

<pageparserpaths>
<pageparserpath virtualpath="/_catalogs/masterpage/*" compilationmode="Always"  allowserversidescript="true" includesubfolders="true".>

</pageparserpaths>