首页 > 代码库 > 后台写js

后台写js

   public ActionResult CheckLogon()        {            var con = "document.write(‘{0}‘)";            if (AuthManager.UserWebIdentity == null)            {                const string text = "<div class=\"count_login\"><span>欢迎来到路游租车!</span><div class=\"login\"><a href=http://www.mamicode.com/"http://passport.luyou666.com/Account/Logon\">登录</a><a class=\"zhuce\" href=http://www.mamicode.com/"http://passport.luyou666.com/Account/VerificationPhoneUser\">注册</a></div></div>";                con = con.FormatValue(text);            }            else            {                var text = "<div class=\"count_login\"><span><a href=http://www.mamicode.com/"http://my.luyou666.com\">" +                           AuthManager.UserWebIdentity.Profile.LoginId +                           "<img src=http://www.mamicode.com/"http://passport.luyou666.com/Content/User/icon/name.gif\" /></a>欢迎来到路游租车!</span><div class=\"tuichu\"><a href=http://www.mamicode.com/"/logout\">退出</a></div></div>";                con = con.FormatValue(text);            }            return Content(con, MimeCollection.Js.ContentType);        }

前端调用

  <script type="text/javascript" src=http://www.mamicode.com/"http://passport.luyou666.com/Account/CheckLogon"></script>

 

后台写js