我有一个SharePoint Web部件,其中包含一个存储密码的web-browsable属性。我使用PasswordPropertyText属性修饰了属性,但每当我编辑Web部件时,它都显示实际的密码而不是点或星号。这是我的财产声明:

<Personalizable(PersonalizationScope.Shared), _
PasswordPropertyText(True), _
WebBrowsable(True), _
WebDisplayName("Your Password"), _
Public Property MyPassword() As String
    Get
        return m_myPassword
    End Get

    Set(value as String)
        m_myPassword = value
    End Set
End Property

SharePoint 2007是否尊重此属性,或者我只是没有正确使用它?

有帮助吗?

解决方案

不幸的是,无法使用属性修饰配置密码属性以显示。

您需要实现自定义编辑器部件并在那里处理MyPassword属性。请参阅此 MSDN上的文章代码示例。使用标准ASP.NET TextBox控件呈现MyPassword属性,并将其TextMode属性设置为 password

其他提示

atrribute仅在Visual Studio的属性窗口或任何属于PropertyGrid的控件中查看时,文本显示为星号。

我恐怕现在找不到任何与将WebParts属性显示为密码字段有关的内容。我会试着找到这个,但我想知道自己。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top