newdocset doesnot seems to work with SPContext.Current.Web I have a HttpModule below is a sample code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Web;
namespace mynamespace
{
class DemoHttpModule : System.Web.IHttpModule
{
public void Dispose()
{
throw new NotImplementedException();
}
public void Init(System.Web.HttpApplication application)
{
application.BeginRequest += new EventHandler(Application_BeginRequest);
application.AcquireRequestState += new EventHandler(this.Application_AcquireRequestState);
application.ReleaseRequestState += new EventHandler(this.Application_ReleaseRequestState);
//To Handel page.PreRender
application.PreRequestHandlerExecute += new EventHandler(this.Application_PreRequestHandlerExecute);
}
private void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication curApp = sender as HttpApplication;
//SPWeb oWeb = SPContext.Current.Web;
}
private void Application_AcquireRequestState(object sender, EventArgs e)
{
HttpApplication curApp = sender as HttpApplication;
if (curApp.Request.Url.ToString().Contains("advsetng.aspx"))
{
return;
}
using (SPSite oSPsite = new SPSite(Convert.ToString(curApp.Request.Url)))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{
}
}
}
private void Application_ReleaseRequestState(object sender, EventArgs e)
{
HttpApplication curApp = sender as HttpApplication;
SPWeb oWeb = SPContext.Current.Web;
}
private void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
HttpApplication curApp = sender as HttpApplication;
SPWeb oWeb = SPContext.Current.Web;
}
}
}
in Application_AcquireRequestState if i am using
using (SPSite oSPsite = new SPSite(SPContext.Current.Web.ID)
{
Then although it is not generating any exception but shows an error message while creating a newdocset stating "This action cannot be completed"
if i am using
using (SPSite oSPsite = new SPSite(Convert.ToString(curApp.Request.Url)))
{
then it is working fine, but the problem with curApp.Request is it will always return the root level web object So are there any alternatives to SPContext.Current.Web.ID
in this link the answer suggested by spunkyvt tells something about a similar problem but i cant use the solution suggested by him simillar problem link
Any suggestions
Thanks Mac