Fabio Carucci's WebLogs

"...You may say I'm a dreamer, but I'm not the only one..." (Imagine)
posts - 50, comments - 39, trackbacks - 7

My Links

News



PER CONSULENZE SCRIVERE SU "CONTACT"

Contattami se sono online!

This is my personal blog. These postings are provided "AS IS" with no warranties, and confer no rights. The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer.








View Fabio Carucci's profile on LinkedIn

Vuoi ricevere i miei post nella tua email? Iscriviti

Add to Technorati Favorites



http://www.csthota.com/blogmap/



Locations of visitors to this page





Tag Cloud

Archives

Post Categories

1 - Pubblicazioni

2 - Conferenze

3 - Links

4 - Blogs

L'arte di lavorare con le WebPart - #13

Uno dei metodi canonici che il WebPart Framework mette a disposizione per disabilitare verbi è quello di utilizzare l'override sul metodo FilterWebPartVerbs e passargli la collection di verbi che si vuole abilitare/disabilitare unitamente alla webpart:

protected override WebPartVerbCollection FilterWebPartVerbs(WebPartVerbCollection verbs, WebPart webPart) { WebPartVerbCollection wpvc = base.FilterWebPartVerbs(verbs, webPart); foreach (WebPartVerb verb in wpvc) { if (verb == this.Zone.EditVerb) verb.Enabled = webPart.AllowEdit; } return wpvc; }

ciò che probabilmente non riusciremo a fare, però, è nascondere il verbo "Edit" per una serie di motivi, primo fra tutti WebPartChrome.ShouldRenderVerb che sembra "ignorare" l' AllowEdit=False soltanto per il verbo "Edit".

Per suggerire un possibile workaround rimando al mio post #3 fermo restando il valido uso del codice suddetto per i restanti verbi.

Print | posted on mercoledì 31 gennaio 2007 0.42 | Filed Under [ ASP.NET 2.0 WebPart ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 4 and 2 and type the answer here:

Powered by: