Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Problem with using FormDigest control

  Asked By: Damaris    Date: May 14    Category: Sharepoint    Views: 2759

I am running my ASP.NET application within the context of the SharePoint
environment. It is installed into the C:\Program Files\Common Files\Microsoft
Shared\web server extensions\12\TEMPLATE\LAYOUTS directory. I have SharePoint
Root site and sub-sites. I use FormDigest control and It seems that the problem
is with adding FormDigest control to the page. It works without any problem, If
I run my app from the Root Site or from a sub-site as a user who has at least
view permissions on the Root site.
If I run my app from a sub-site as a user who does not have permissions to the
Root Site, I get the error :

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
ssException ex)
at Microsoft.SharePoint.Library.SPRequest.RenderFormDigest(String bstrUrl,
ISPDataCallback pFormCallback)
at Microsoft.SharePoint.WebControls.FormDigest.RenderCore(SPWeb web)
at Microsoft.SharePoint.WebControls.FormDigest.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Here is the code how I add FormDigest control on the page:
protected void Page_Load(object sender, EventArgs e)
FormDigest formDigest = new FormDigest();
formDigest.ID = "formDigest";




1 Answer Found

Answer #1    Answered By: Cole Curtis     Answered On: May 14

Just use one of the standard SharePoint masterpages and you won't have to
worry about it. They already include an appropriate FormDigest control  and
you should have only one anyway.

Didn't find what you were looking for? Find more on Problem with using FormDigest control Or get search suggestion and latest updates.