views:

207

answers:

1

I am trying to develop web parts in VS 2008/WinXP

I created a Web Site project, and added a couple of web parts within the default form in default.aspx

<form id="form1" runat="server">
<div>
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    </asp:WebPartManager>    
    <asp:WebPartZone ID="WebPartZone1" runat="server">
    </asp:WebPartZone>    
</div>
</form>

When I first ran it (in the debugger), a popup told to me enable Windows authentication in IIS (so something is working!). I enabled the Windows authentication, and now when I run it I get a blank screen. Same result if I open it in IE via the url (rather than debugger).

Note - the source view shows lots of a javascript - in particular, it declares a WebPartManager object, and adds a zone to it ("__wpm.AddZone(..)")

+1  A: 

Because of Windows User Account Control (UAC), when working with Windows Vista or Windows Server 2008, the local Administrators group will behave differently than other groups. The attribute won’t correctly recognize a member of the local Administrators group unless you modify your computer’s UAC settings.

Exactly what happens when you attempt to invoke a controller action without being the right permissions depends on the type of authentication enabled. By default, when using the ASP.NET Development Server, you simply get a blank page. The page is served with a 401 Not Authorized HTTP Response Status.

If, on the other hand, you are using IIS with Anonymous authentication disabled and Basic authentication enabled, then you keep getting a login dialog prompt each time you request the protected page.

Steav
Is it because of Personalization? if it is, is there anyway to disable it?tks
Gabriel Guimarães
by "Personalization" do you mean that Web Parts only work when some kind of site identity or login is enabled? My understanding is that this is required - that is why it doesn't work with anonymous login. I got it working, by enabling Windows Authentication, then setting the WebPartManager.DisplayMode.
Javaman59
Thanks! Following this up... 1. It won't work with Anonymous Authentication (under IIS-><the site>->Properties->Directory Security->Anonymous access a...) 2. With Windows Authentication, it works in the debugger (F5), but only with the current login ID. 3. With Basic Authentication it prompts for user id and password, but doesn't work in debugger (ie. run it with localhost url in browser). 4. [THE MAIN ISSUE] The WebPartManager and WebPartZone by themselves will not show anything - set "this.WebPartManager1.DisplayMode = WebPartManager.ConnectDisplayMode;" and/or add a web part to the zone.
Javaman59