<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Master Page Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/master-page/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/master-page/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 13 Feb 2012 12:33:54 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Displaying Current User In SharePoint Master Page</title>
		<link>https://blog.binarybits.net/displaying-current-user-in-sharepoint-master-page/</link>
					<comments>https://blog.binarybits.net/displaying-current-user-in-sharepoint-master-page/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 12:33:54 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Master Page]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[UserName]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=213</guid>

					<description><![CDATA[<p>One of the requirements while I was working in SharePoint 2010 was displaying the user name in the master page. So the following are the 2 pieces of code. Add the following code to the body tag inside master page. Make sure the below code is outside of any tag which has the runat=&#8221;server&#8221; property [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/displaying-current-user-in-sharepoint-master-page/">Displaying Current User In SharePoint Master Page</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One of the requirements while I was working in SharePoint 2010 was displaying the user name in the master page.</p>
<p>So the following are the 2 pieces of code.</p>
<p>Add the following code to the body tag inside master page. Make sure the below code is outside of any tag which has the runat=&#8221;server&#8221; property set.</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;var loginName = &#8220;&lt;%= Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.Name %&gt;&#8221;;&lt;/script&gt;</p>
<p>Now put the following code where ever required.</p>
<p>&lt;span&gt;Welcome, &lt;script type=&#8221;text/javascript&#8221;&gt;document.write(loginName);&lt;/script&gt;&lt;/span&gt;</p>
<p>&nbsp;</p>
<p>If you face the following error&#8230;check out the link <a href="https://blog.binarybits.net/?p=207">https://blog.binarybits.net/?p=207</a></p>
<blockquote><p>An unexpected error has occurred </p></blockquote>
<p>If you face the following error&#8230;check out the link <a href="https://blog.binarybits.net/?p=215">https://blog.binarybits.net/?p=215</a></p>
<blockquote><p>Code blocks are not allowed in this file</p></blockquote>
<p>If you face the following error&#8230; check out the link <a href="https://blog.binarybits.net/?p=211">https://blog.binarybits.net/?p=211</a></p>
<blockquote><p>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% … %&gt;).</p></blockquote>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/displaying-current-user-in-sharepoint-master-page/">Displaying Current User In SharePoint Master Page</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/displaying-current-user-in-sharepoint-master-page/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-04-23 06:42:02 by W3 Total Cache
-->