I have a custom webpart and when it first renders I want to give link to open modify shared webpart properties as we generally get when we open OOB webparts like Content editor or XML webpart? Any one is having idea on this ...I was using this but when I m clicking on it, its showing following error
I m using this:
LiteralControl lctrl = new LiteralCont开发者_运维问答rol();
lctrl.Text=string.Format("<a id='MsoFrameworkToolpartDefmsg_{0}' href=\"javascript:MSOTlPn_ShowToolPane2Wrapper('Edit','129','{0}');\">Open the tool pane</a> and enter a valid value.",this.ID);
Controls.Add(lctrl);
ERROR: A Web Part you attempted to change is either invalid or has been removed by another user.Click to refresh it.(This its showing in my toolpane)
Taken from a working webpart:
myvar = "<a href=\"javascript:MSOTlPn_ShowToolPane2Wrapper('Edit', this, '" + ID + "')\">Open the toolpanel</a>"
"ID" is the webpart ID. I use a UserControl to hold my WebPart code, so I use Parent.ID
精彩评论