Does anybody know how to reliably retrieve the CommandBar for the Context menu for the ASP.NET designer?
I'm working on my Web Connection Add-in to pop up VFP ontop of Visual Studio and I need to add a couple of menu items to the context menu. I have it working just fine in the CodeBehind page which works with a Commandbar named "ASP.NET Context".
I also managed to find the ASP.NET designer context that works which is a CommandBar named "Context". But Context is not reliable – if you're on a the base page it works. But if you sit on a Table object, commands are no longer visible. Apparently this is a different context menu and the plain 'Context' is no longer in scope. This is a problem because if you happen to have a page that's laid out with a table panel layout you can click a few edge portions of the page to get a menu – hardly user friendly.
I'm just not sure why 'Context' isn't working. If I look for other related items that show up on the menu I see – they are all on the 'Context' menu, but my items aren't showing up.
To debug I have a routine that goes through all CommandBars and prints out the Commandbar names and their child controls. The relevant section captured looks like this:
Context
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
&Style... - 746
Run As Ser&ver Control - 746
View &Code - 746
View Component Des&igner - 746
View in &Browser - 393219
Edit &Master - 746
Add Co&ntent Page - 10944558
Edit &Image - 746
Show Smart Ta&g - 746
WebForms Designer Verbs - 746
Ed&it Template - 32768
E&nd Template Editing - 746
Re&fresh - 393222
Show Web Connection Code - 112
Show in Browser - 112
P&roperties - 393246
Basic Context
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
Collapse Ta&g - 746
Synchroni&ze Document Outline - 746
Stop Outlining Tag - 746
Move &into Project - 32768
Context
View &Code - 393241
&Add - 32768
Edit &key... - 11075595
D&elete key - 746
Edit &Relation... - 11075596
Make Type &Global - 11075597
&Show Default Tree - 746
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
Context
View &Code - 393241
&Add - 32768
E&xpand - 746
&Collapse - 746
Edit &key... - 11075595
D&elete key - 746
Edit &Relation... - 11075596
Make Type &Global - 11075597
&Show Default Tree - 746
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
Context
Edit &Relation... - 11075596
Context
View &Code - 393241
Context
Select &Tag - 746
Select Tag &Content - 746
Context
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
&Style... - 746
&Insert - 32768
De&lete - 32768
&Select - 32768
&Resize - 32768
&Merge Cells - 798
Run As Ser&ver Control - 746
View &Code - 746
View Component Des&igner - 746
View in &Browser - 393219
Edit &Master - 746
Add Co&ntent Page - 10944558
Show Smart Ta&g - 746
WebForms Designer Verbs - 746
Ed&it Template - 32768
E&nd Template Editing - 746
P&roperties - 393246
HTML Context
Cu&t - 21
Cop&y - 19
&Paste - 22
Past&e Alternate - 746
&Delete - 478
View &Code - 746
View in &Browser - 393219
&Add Tag Handler - 746
Edit Tag &Handler - 746
&Remove Tag Handler - 746
&Breakpoint - 32768
Add &Watch - 229
&QuickWatch... - 229
S&how Next Statement - 1812
Step Into Speci&fic - 32768
Ru&n To Cursor - 1811
Set Ne&xt Statement - 1813
Go To &Disassembly - 1310743
Collapse Ta&g - 746
Synchroni&ze Document Outline - 746
Stop Outlining Tag - 746
&Format Selection - 11010051
Formatting and &Validation... - 746
Move &into Project - 32768
Context
Run As Ser&ver Control - 746
View &Code - 746
P&roperties – 393246
My code gets to the first Context bar (you can see the two Web Connection items on the bottom registered there).
What's disturbing about this that there are about 5 Context command bars – at least two of them (the large ones) are identical and I see my bars on the first instance but not the second. Which is likely WHY they are not displaying. But why are there two commandbars with the same damn name, that doesn't make sense.
So has anybody done this before? How do I get my items on the right command bars so they ALWAYS show up in the ASP.NET designer, no matter what type of control is active?
This sort of thing works just fine in Windows forms where you have to hook two CommandBars: Selection and Containers. For kicks I tried those too but the ASP.NET designer doesn't appear to use those.
Anyway, I'm hoping somebody out there has done this before or maybe somebody from Microsoft has some information on this.