How to add Welcome before username
In moss 2007 the welcome control used to appear like "Welcome Username开发者_Go百科". But in sharepoint 2010 only user name appears in ribbon. How can I add "Welcome" before username in sharepoint 2010 welcome control.
You could try the reverse of what Wictor did in Having fun with the SharePoint Welcome.ascx control. While he wanted to get rid of "Welcome," you could set TextType
to PostCacheSubstitutionTextType.WelcomeUser
to include it. However, as mentioned in this comment, be sure to create your own control and modify your master page, rather than changing Welcome.ascx directly.
Another option would be jQuery. If you are using v4.master, the selector for the user name should be: div.s4-trc-container-menu span.ms-welcomeMenu a.ms-menu-a span
. Once you grab the element, you could prepend "Welcome " to the text.
精彩评论