Displaying K2 tasks in a web part

  • 30 October 2003
  • 1 reply
  • 0 views

Badge
Hi,

I am trying to build a web part to display the K2 tasks allocated to a user in a Sharepoint web part.

The code I have connects to the server perfectly, but it somehow loses the context of the logged on user and thus yielding no tasks as results.

This is the code I am using :

private string RenderWorkList()
{
StringBuilder sb = new StringBuilder();
Connection conn = new Connection();
conn.Open("PROJECTSERVER");
Worklist workList = conn.OpenWorklist("ASP");

foreach (WorklistItem item in workList)
{
//build up html
}
conn.Close();
return sb.ToString();
}


Any ideas? :roll:

1 reply

Badge +7
For ASP.NET pages to use integrated windows authentication with K2.net, please check that the IIS "Allow anonymous access" option for your web application is not enabled.
http://forum.sourcecode.com.sg/images/userimages/iis_anon_access.png

If disabling anonymous access for your web application is not an option, you would need to specify the connection string in the Connection class Open method call (see code sample below). You may also need to maintain the credentials of the current user in session variables for use in the connection string. This approach is typically used in environments that do not use Active Directory for authentication.

conn.Open("PROJECTSERVER","domain,user,password");

Reply