Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Sharepoint 2007 / 2010 Forums

Problems with webparts when anonymous user is viewing the page.
Last Post 21 May 2007 07:20 AM by Tor-Øyvind Eriksen. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Tor-Øyvind EriksenUser is Offline
New Member
New Member
Posts:2

--
18 May 2007 02:26 AM

    Hello,

    I have build a sharepoint 2007 site to be used as a internet site, without users needing to log in.

    The problem is when I add my own webparts to a page. I get a "401 UNAUTHORIZED". I have developed the webparts in C#, and deployed them as described here:
     http://www.codeguru.com/csharp/.net...hp/c12293/

    (However added the dll file to the GAC and not the the _app_bin directory)

    Everything works fine as long as I am logged in, but they doesn't seem to work for anonymous users.

     

    Any suggestions out there?

     

     

    Chad NashUser is Offline
    Senior Member
    Senior Member
    Posts:5260

    --
    18 May 2007 11:22 AM

    Ummm. Do you use any resource files?

    This article does outline some great details.

    A few things, there are a few ways of building an deploying web parts with a few general requirements. Typically you would want to make sure you have the .webpart file (DWP file such as name.webpart), manifest.xml file if you are building a solution, and in general the DLL). Although some of these are optional if you are just trying to deploy and get it working on a development server.

    A few things to check.
    1. Make sure it was signed (would have to be for you to add to the GAC anyway)
    2. Make sure you have the safe control property added in the web.config file.
    3. If you re-build the application and are using the GAC make sure you remove and re-add the file
    4. Not that you should have to but for testing purposes you can always change the line Trust = "WSS_Minimal" to be Trust = "Full" in the web.config.

    Also, at what point do you get the error? Are you able to go as the article describes to Site Settings, Web Parts, New, and does your web part show up there correctly?

    Finally, I would start with a 'Hello World' within the render contents event so that you know its not directly related to any specific code you have.

    -Chad

    Chad NashUser is Offline
    Senior Member
    Senior Member
    Posts:5260

    --
    18 May 2007 11:23 AM
    I just read your part again about it not working only for anonymous users (whoops ). In that case, does 'Hello World' work? It might be code specific, for example if its references a folder on your server that the permissions need to be updated on.

    -Chad
    Tor-Øyvind EriksenUser is Offline
    New Member
    New Member
    Posts:2

    --
    21 May 2007 07:20 AM
    Thanks Chad,

    The Hello World part works, I just kept adding components until it broke again. It seems like I have some problems with caching:

    if ((this.PartCacheRead(Storage.Shared, this.ID) != null))
    {
    layoutHtml = this.PartCacheRead(Storage.Shared, this.ID).ToString();
    }
    else
    {
    layoutHtml = GetRenderItem();

    this.PartCacheInvalidate(Storage.Shared, this.ID);
    this.PartCacheWrite(Storage.Shared, this.ID, layoutHtml, TimeSpan.FromSeconds(_cacheTimeout));
    }
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi