SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


Enabling sessionState  

Jun 222008

The sessionState allow you to store information not in the ViewState, but in the HttpSession object. See MSDN.

To enable the sessionState, you will have to modify your web.config. All lines which need to be modified, are within the <system.web> tag:

In the default settings, the httpModule for the session state is commented out. We will simply remove the "<!--" and "-->" around the line.

   1: <httpModules>
   2:   <clear />
   3:     ...
   4:   <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
   5:     ...
   6: </httpModules>

 

Change the value for enableSessionState from "false" to "true":

   1: <pages enableSessionState="true" enableViewState="true" ...>

That's it. Now you can use the session state.

Tags:

 
Posted by René Hézser | 7  Comments | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: SharePoint
Technorati Tags:

Links to this post

Comments

commented on  Tuesday, January 27, 2009  11:57 PM  by  Trying to install fileserver feature problems
HI Rene,
I installed the newest version of your fileserver feature, It orignially complained because of the session state, so I made the above modifications and now it complains about about a startIndex.
Stack Trace is as follows, any ideas?:
[ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +2916027
System.String.Substring(Int32 startIndex) +17
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.Log(HttpContext context, SPWeb spWeb, Int64 bytes, UInt32 version) +532
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostRequestExecuteHandler(Object oSender, EventArgs ea) +199
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

commented on  Wednesday, January 28, 2009  7:50 PM  by  re: Trying to install fileserver feature problems
Hi,
this stacktrace does not point to a problem with the Webpart.
Is there more information?

René

commented on  Monday, February 02, 2009  9:17 PM  by  Problem Solved
Hi Rene,
First, let me say how cool of a feature this is, you've done a good job with it.
Second, the problem was that I am using Windows Server 2008, you made a comment on your blog about an update in upload size that applies to Win2k8. I installed that change and now works.
Thirdly, I am wondering if you are releasing source code for this? I want the url to be dynamic based on who is logged in to the site. So, I'm hoping to make the fileserver path dynamic, it would be really cool to have this webpart to be able to be connected to another, that we can add the fileserver path to. This would separate that functionality from the actual web part.

Anyway, let me know, I would like to use this for a solution, but I would need the source code to do this. Thanks

you can email me at juanl at imaginets.com

thanks again

commented on  Monday, January 17, 2011  11:52 PM  by  Anonymous
I made the change above, in both the site and the admin site. I still get the error.

IIS7 SharePoint2010 Ent.

commented on  Tuesday, February 01, 2011  1:20 AM  by  Charles_Gray
I am attempting to install the Fileserver Access web part on my Sharepoint 2010 server. Does this work? So far I have installed it ok, but when I launch the web part, I get the error "The current session is null". It is pointing to a network file share and I can access the same share via windows explorer. I noted that ajax and kerberos may be needed. Do I need to install either of these? I am new to sharepoint and any tips would be appreciated.

commented on  Wednesday, July 06, 2011  2:18 PM  by  Volker
To enable the SessionState do the following:

Please Configure the web.config as described above. Then, you must go into your web application and add the same session state module to the IIS7 managed pipeline.

1. Open the IIS 7 manager, and select your webapp.
2. Double click "Modules" in the IIS section.
3. Click "Add Managed Module".
4. In the Add Managed Module dialog, enter "SessionState" or something like that for the name, and choose the following item from the dropdown:
System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

After that, session state should be enabled for your webapp.

commented on  Monday, August 01, 2011  12:49 PM  by  Swetha
I perfectly installed solution and added webpart. I can able to access network folder but internally when I am trying to open any of the file I am getting following error. Please guide me.

The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[COMException (0x800401e6): The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>]
Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAndMetaInfo(String bstrUrl, Byte bPageView, Byte bPageMode, Byte bGetBuildDependencySet, String bstrCurrentFolderUrl, Int32 iRequestVersion, Boolean& pbCanCustomizePages, Boolean& pbCanPersonalizeWebParts, Boolean& pbCanAddDeleteWebParts, Boolean& pbGhostedDocument, Boolean& pbDefaultToPersonal, Boolean& pbIsWebWelcomePage, String& pbstrSiteRoot, Guid& pgSiteId, UInt32& pdwVersion, String& pbstrTimeLastModified, String& pbstrContent, Byte& pVerGhostedSetupPath, UInt32& pdwPartCount, Object& pvarMetaData, Object& pvarMultipleMeetingDoclibRootFolders, String& pbstrRedirectUrl, Boolean& pbObjectIsList, Guid& pgListId, UInt32& pdwItemId, Int64& pllListFlags, Boolean& pbAccessDenied, Guid& pgDocid, Byte& piLevel, UInt64& ppermMask, Object& pvarBuildDependencySet, UInt32& pdwNumBuildDependencies, Object& pvarBuildDependencies, String& pbstrFolderUrl, String& pbstrContentTypeOrder) +0
Microsoft.SharePoint.Library.SPRequest.GetFileAndMetaInfo(String bstrUrl, Byte bPageView, Byte bPageMode, Byte bGetBuildDependencySet, String bstrCurrentFolderUrl, Int32 iRequestVersion, Boolean& pbCanCustomizePages, Boolean& pbCanPersonalizeWebParts, Boolean& pbCanAddDeleteWebParts, Boolean& pbGhostedDocument, Boolean& pbDefaultToPersonal, Boolean& pbIsWebWelcomePage, String& pbstrSiteRoot, Guid& pgSiteId, UInt32& pdwVersion, String& pbstrTimeLastModified, String& pbstrContent, Byte& pVerGhostedSetupPath, UInt32& pdwPartCount, Object& pvarMetaData, Object& pvarMultipleMeetingDoclibRootFolders, String& pbstrRedirectUrl, Boolean& pbObjectIsList, Guid& pgListId, UInt32& pdwItemId, Int64& pllListFlags, Boolean& pbAccessDenied, Guid& pgDocid, Byte& piLevel, UInt64& ppermMask, Object& pvarBuildDependencySet, UInt32& pdwNumBuildDependencies, Object& pvarBuildDependencies, String& pbstrFolderUrl, String& pbstrContentTypeOrder) +589

[SPException: The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.]
Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +27254482
Microsoft.SharePoint.Library.SPRequest.GetFileAndMetaInfo(String bstrUrl, Byte bPageView, Byte bPageMode, Byte bGetBuildDependencySet, String bstrCurrentFolderUrl, Int32 iRequestVersion, Boolean& pbCanCustomizePages, Boolean& pbCanPersonalizeWebParts, Boolean& pbCanAddDeleteWebParts, Boolean& pbGhostedDocument, Boolean& pbDefaultToPersonal, Boolean& pbIsWebWelcomePage, String& pbstrSiteRoot, Guid& pgSiteId, UInt32& pdwVersion, String& pbstrTimeLastModified, String& pbstrContent, Byte& pVerGhostedSetupPath, UInt32& pdwPartCount, Object& pvarMetaData, Object& pvarMultipleMeetingDoclibRootFolders, String& pbstrRedirectUrl, Boolean& pbObjectIsList, Guid& pgListId, UInt32& pdwItemId, Int64& pllListFlags, Boolean& pbAccessDenied, Guid& pgDocid, Byte& piLevel, UInt64& ppermMask, Object& pvarBuildDependencySet, UInt32& pdwNumBuildDependencies, Object& pvarBuildDependencies, String& pbstrFolderUrl, String& pbstrContentTypeOrder) +27641455
Microsoft.SharePoint.SPWeb.GetWebPartPageContent(Uri pageUrl, Int32 pageVersion, PageView requestedView, HttpContext context, Boolean forRender, Boolean includeHidden, Boolean mainFileRequest, Boolean fetchDependencyInformation, Boolean& ghostedPage, Byte& verGhostedPage, String& siteRoot, Guid& siteId, Int64& bytes, Guid& docId, UInt32& docVersion, String& timeLastModified, Byte& level, Object& buildDependencySetData, UInt32& dependencyCount, Object& buildDependencies, SPWebPartCollectionInitialState& initialState, Object& oMultipleMeetingDoclibRootFolders, String& redirectUrl, Boolean& ObjectIsList, Guid& listId) +1750
Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.FetchWebPartPageInformationForInit(HttpContext context, SPWeb spweb, Boolean mainFileRequest, String path, Boolean impersonate, Boolean& fGhostedPage, Byte& verGhostedPage, Guid& docId, UInt32& docVersion, String& timeLastModified, SPFileLevel& spLevel, String& masterPageUrl, String& customMasterPageUrl, String& webUrl, String& siteUrl, Guid& siteId, Object& buildDependencySetData, SPWebPartCollectionInitialState& initialState, String& siteRoot, String& redirectUrl, Object& oMultipleMeetingDoclibRootFolders, Boolean& objectIsList, Guid& listId, Int64& bytes) +26195281
Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.FetchWebPartPageInformation(HttpContext context, String path, Boolean impersonate, Boolean& fGhostedPage, Byte& verGhostedPage, Guid& docId, UInt32& docVersion, String& timeLastModified, SPFileLevel& level, String& masterpageUrl, String& customMasterPageUrl, String& webUrl, String& siteUrl, Guid& siteId, Object& buildDependencySetData) +388
Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.GetWebPartPageData(HttpContext context, String path, Boolean throwIfFileNotFound) +545
Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.GetVirtualPathProviderCacheKey(String virtualPath) +68
Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath) +67
Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.GetCacheKey(String virtualPath) +31
System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP) +38
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +82
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +116
System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +38
System.Web.UI.SimpleHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +67
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +425
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263



Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation