开发者

External Paramaters- Webparts- Sharepoint

I am trying to pass some parameters to the webpart using the following code. I am providing some default value to the same but there are not being reflected. Could anybody point me what is been missing.

 [System.Web.UI.WebControls.WebParts.WebBrowsable(true),
    System.Web.UI.WebControls.WebParts.WebDisplayNameAttribute("Databse Name"),
    System.Web.UI.WebControls.WebParts.WebDescriptionAttribute("Databse Name"),
    System.Web.UI.WebControls.WebParts.Personalizable(
    PersonalizationScope.Shared, true),
    System.ComponentModel.DefaultValue("DatabaseNameDefaultValue"),
    System开发者_如何学JAVA.ComponentModel.CategoryAttribute("Webpart Parameters")
   ]
    public string Database
    {
        get
        {
            return _Database;
        }
        set
        {
            _Database = value;
        }
    }

I cannot see the default value not being assigned.

Thank you.

Hari Gillala


It will only apply the default on brand new instances of the webpart.

And also only if the value isn't in a .webpart file that you're importing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜