PublicActionResult Checklogon () {varCon ="document.write (' {0} ')"; if(Authmanager.userwebidentity = =NULL) { Const stringText ="<div class=\ "count_login\" ><span> Welcome to the road Tour car rental! </span><div class=\ "login\" ><a href=\ "http://passport.luyou666.com/account/logon\" > Login </a ><a class=\ "zhuce\" href=\ "Http://passport.luyou666.com/account/verificationphoneuser\" > Registration </a> </div></div>"; Con=con. Formatvalue (text); } Else { varText ="<div class=\ "count_login\" ><span><a href=\ "http://my.luyou666.com\" >"+AuthManager.UserWebIdentity.Profile.LoginId+"</a> Welcome to the road Tour car rental! </span><div class=\ "tuichu\" ><a href=\ "/logout\" > Exit </a></div></div>"; Con=con. Formatvalue (text); } returnContent (Con, MimeCollection.Js.ContentType); }
Front-end invocation
<script type="text/javascript" src="http://passport.luyou666.com/ Account/checklogon"></script>
Background Write JS