Thursday, February 11, 2010

Sharepoint 2010 is on the way...

Those folks who wanted to get a fair idea about SharePoint 2010 should go thru here :


http://sharepoint2010.microsoft.com/Pages/default.aspx

and the videos are posted here: http://sharepoint2010.microsoft.com/Pages/videos.aspx

Happy SharePointing!!!

how to iterate through a hashtable:

how to iterate through a hashtable
if you have a hashtable and if you want to extract key/value pair;iterating through a hashtable://declare and define Hashtable htItem = new HashTable();
//now loop thru the key /value pair
foreach (DictionaryEntry de in htItem){splstitem[de.Key.ToString()] = de.Value.ToString();}*********************************suppose if you have acworkflow attached in your custom splist and if you wanna update the workflow task belwo is the LOC:we need to use the SPWorkflowTask.AlterTask. the most imp.part here is ht: a hashtable.
public string UpdateWorkflowTasks(Hashtable ht, int TaskID){string strRequestorsID = string.Empty;using (SPSite site = new SPSite(strUrl)){using (SPWeb web = site.OpenWeb()){web.AllowUnsafeUpdates = true;try{SPListItem taskItem = null;SPList listTasks = web.Lists["Tasks"];taskItem = listTasks.Items.GetItemById(TaskID);SPWorkflowTask.AlterTask(taskItem, ht, false);strRequestorsID = Convert.ToString(taskItem["strRequestorsID "]);}catch (Exception ex){
}web.AllowUnsafeUpdates = false;}}return strRequestorsID;

Tuesday, February 9, 2010

VS 2010 RC

Great news to all VS 2010 lovers!!!

Finally the VS 2010 has been released as an RC and its available as download:

Thanks to Soma (http://blogs.msdn.com/somasegar/archive/2010/02/08/visual-studio-2010-and-net-framework-4-release-candidate-now-available.aspx ) by announcing the same in his blog.

MSDN subscribers can downlaod the RC in the below link:

http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx

thanks

Tuesday, December 29, 2009

assign a task to multiple users in SharePoint 2007 workflow

In one of my recent projects we have to assign a task to group of users in sharepoint custom statemachine workflow.After some googling I found that ReplicatorContactSelector can not be applciable to StateMachine WF. So If you are having a requirement like SendBack to previous Approver/Initiator ReplicatorContactSelector will not work.At last interacting with our MSFT consultant Avneesh Kaushik ( http://www.avneeshnagina.com/ ) internal MOSS experts, we have came to a conclusion that the solution is dynamicallly create a SPGroup of users who are supposed to approve/reject the task and assign the task to this dynamic group.
the steps are given below on how to execute this:
1 Create a splist column -say -->-"GroupToAssign"
2 Store the dynamic group name created in this list column.
3 Once the WF completes, just delete the group, by calling
string groupName = objSPListItem["GroupToAssign"].ToString();
oSPWeb.ParentWeb.SiteGroups.Remove(groupName);
This way we can assign a task to mulitple users/groups
Also remember to assign the Contribute permission to the members of this group :

This discussion can be found in the below thread:
http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/eaa3a47d-e274-47ae-9f81-f51ec5c91756
Hope anybody who is going to implement the same may find it helpful.

Happy programming!!!

Monday, October 27, 2008


For one of my clients I have to pass /transmit data from one aspx page to another.Though I can use I was Session , hidden fields,Request.QueryString() for this, i was curious to know whether I can leverage ASP.NET 2.0 features to achieve this.After little bit of googling I have found that with the use of postbackurl property of a submit button and adding a
<%@ PreviousPageType VirtualPath="~/My Web Site/source.aspx" %> directive we can manipulate the information in the target page.in the code behibnd page we have to write the follow. using the Page.PreviousPage property: here i have used the master page concept and based on the ContentPlaceHolder id of the master page , I am finding the controls listed in the source page

if (PreviousPage != null && PreviousPage.IsCrossPagePostBack && PreviousPage.IsValid)
{
if ((PreviousPage.Master != null))
{
labelError.Visible = false;
ContentPlaceHolder cph1 = (ContentPlaceHolder)Page.PreviousPage.Master.FindControl("cph");
if (cph1 != null)
{
ListBox lstCountry = (ListBox)cph1.FindControl("lstCountry"); //lstCountry is a control the source.aspx page.

}

now you can access the selecteditems/ its value or or its index as we do in the normal way.
if (lstCountry.SelectedItem.Text == "--All--" && tlstCountry.Items.Count >0)

{

//do some process here.

}
in the source.aspx page file if there exists a submit button / hyperlink button

thats all..

the concept is known as CrossPage Postback , a new feature introduce din ASP.NET 2.0.!!!!

Happy ASP.Neting...

Sunday, October 19, 2008

Silverlight 2 released


The .NET centric rich web experience software known as

Silverlight 2 has been released.

Get more info. from Soma's blog:

http://blogs.msdn.com/somasegar/archive/2008/10/13/silverlight-2-released.aspx

You can download Silverlight 2, at http://www.microsoft.com/silverlight

Anugurihiitosumi,

prasad.