add this Code in your web part class in
public override WebPartVerbCollection Verbs property and change it according to your Requirement
using (SPSite spSite = new SPSite("http://abc.com/"))
using (SPWeb spWeb = spSite.OpenWeb())
{
if (spWeb.CurrentUser.Name == "Customize" || spWeb.CurrentUser.Name == "abc\\Customize")
{
WebPartVerb configureSettingsVerb = new WebPartVerb("ConfigureSettings", ConfigureSettingsClickEventHandler);
configureSettingsVerb.Text = "Configure Settings";
configureSettingsVerb.ImageUrl = "../../../_layouts/images/icon-controllerConfiguration.png";
WebPartVerbCollection newVerbs = new WebPartVerbCollection(new WebPartVerb[] { configureSettingsVerb });
return (new WebPartVerbCollection(base.Verbs, newVerbs));
}
return (new WebPartVerbCollection(null, null));
public override WebPartVerbCollection Verbs property and change it according to your Requirement
using (SPSite spSite = new SPSite("http://abc.com/"))
using (SPWeb spWeb = spSite.OpenWeb())
{
if (spWeb.CurrentUser.Name == "Customize" || spWeb.CurrentUser.Name == "abc\\Customize")
{
WebPartVerb configureSettingsVerb = new WebPartVerb("ConfigureSettings", ConfigureSettingsClickEventHandler);
configureSettingsVerb.Text = "Configure Settings";
configureSettingsVerb.ImageUrl = "../../../_layouts/images/icon-controllerConfiguration.png";
WebPartVerbCollection newVerbs = new WebPartVerbCollection(new WebPartVerb[] { configureSettingsVerb });
return (new WebPartVerbCollection(base.Verbs, newVerbs));
}
return (new WebPartVerbCollection(null, null));
No comments:
Post a Comment