在asp.net中显示为空白页简单的Web部件 [英] simple web parts in asp.net show as blank page

查看:122
本文介绍了在asp.net中显示为空白页简单的Web部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发Web部件的 VS 2008 / WinXP中

我创建了一个网站项目,并添加了几个默认的窗体中的Web部件 Default.aspx的

 <表ID =form1的=服务器>
< D​​IV>
    < ASP:WebPartManager的ID =WebPartManager1=服务器>
    < / ASP:WebPartManager的>
    < ASP:WebPartZone控件ID =WebPartZone1=服务器>
    < / ASP:WebPartZone中>
< / DIV>
< /表及GT;

当我第一次运行它(在调试器),一个弹出告诉我启用IIS的Windows身份验证(这样的东西是工作!)。我启用了Windows身份验证,而现在当我运行它,我得到了一个空白屏幕。如果我通过URL(而非调试器)在IE中打开相同的结果。

请注意 - 源视图显示大量一个JavaScript的 - 特别是,它声明的 WebPartManager的对象的,并增加了一个区给它( __ wpm.AddZone(..)


解决方案

  

由于Windows用户帐户
  控制(UAC),与工作时
  Windows Vista或Windows Server 2008中,
  本地Administrators组会
  不同的表现比其他群体。
  该属性不能
  正确识别的一个部件
  本地Administrators组,除非你
  修改计算机的UAC设置。


究竟是什么,当你尝试调用一个控制器动作没有被正确的权限发生取决于启用的身份验证类型。默认情况下,使用ASP.NET开发服务器时,你只是得到一个空白页。该页面送达401没有获得许可的HTTP响应状态。

如果,在另一方面,您使用的匿名身份验证禁用基本身份验证启用IIS,那么你就不断收到一个登录对话框每次请求保护的页面时提示。

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(..))

解决方案

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.

这篇关于在asp.net中显示为空白页简单的Web部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆