惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - joe

通过70-542 在sharepoint中利用文档库扩展新闻应用(引用) 屏蔽“网站操作”菜单 图片库不能以缩略图方式显示的原因 - joe - 博客园 一个文档库权限控制的eventhandler 新建文件夹的时候自动按照文档库模板生成子文件夹和文件的解决代码 在SSP中通过ldap方式导入用户信息 form认证搜索不了的解决办法 form认证让“记住我”自动勾上 - joe - 博客园 安装MOSS的账号问题 Excel Calculation Services 无法启动的原因 sharepoint域认证的时候给用户一个友好的登陆界面 实现sharepoint 内容编辑器直接上传图片功能 sharepoint2007单点登陆问题 用户信息不同步的问题 在其他应用程序上传文件到MOSS文档库的例子 此网页的安全性验证无效并且可能损坏的错误的解决方法 找到表中某一列值相同的记录,而且只要其中一条记录的sql 三、设计一个K2.net2003的工作流程
wss2 如何在页面上显示登陆的用户名
joe · 2007-10-19 · via 博客园 - joe

This is one of my favorites.  I want my site to say, “Hello, John Jansen, welcome to this site“ or whatever.  But since you can't author server-side code with SharePoint sites, there is no evident way to do this.  The way I get around this limitation is to code XSLT and make it do what I want.

1. Insert a Data View Web Part based on the Announcements list
2. Click on Data > Conditional Formatting
3. Select any data value and Click on Create
4. Click on Show Content
5. Create a Condition that says: Title EQUALS [Current User] and click OK back to the Design view
6. Type “Hello, welcome to this site“ inside one of the Table cells
7. Switch to Code view
8. Find the following code:
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
9. Change this code to this:
<ParameterBinding Name="UserID" Location="CAMLVariable;ServerVariable(LOGON_USER)" DefaultValue="CurrentUserName"/>
10. Scroll up in the code and find “Hello, welcome to this site”
11. Change this code to say this:
“Hello, <xsl:value-of select="$UserID"/> welcome to this site”
12. Save the page

Interesting notes:

First, you will see the user name repeat for each value in the Data View, so you should change the display using Data..Style so that it only shows One record.

Second, the ServerVariable() can be any of the server variables as documented on MSDN.

Third, the reason we created the Conditional Formatting in steps 2 - 5 was to make sure $UserID would be in scope.

Hope this works for ya!

-John