<script type="text/javascript">
var action = GetUrlKeyValue('accountname').toLowerCase();
var loginName = "<%= Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.LoginName.ToString().Replace('\\', '/').ToLower() %>";
if((action.replace("\\","/")== loginName))
{
代码块
}else if(action == '')
{
代码块
}else{
代码块
}
</script>
需要修改webconfig文件
<PageParserPaths>
<PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> <PageParserPath VirtualPath="/my/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> </PageParserPaths>