码迷,mamicode.com
首页 > Web开发 > 详细

后台写js

时间:2014-11-27 12:05:55      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   java   for   

   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://passport.luyou666.com/Account/Logon\">登录</a><a class=\"zhuce\" href=\"http://passport.luyou666.com/Account/VerificationPhoneUser\">注册</a></div></div>";
                con = con.FormatValue(text);
            }
            else
            {
                var text = "<div class=\"count_login\"><span><a href=\"http://my.luyou666.com\">" +
                           AuthManager.UserWebIdentity.Profile.LoginId +
                           "<img src=\"http://passport.luyou666.com/Content/User/icon/name.gif\" /></a>欢迎来到路游租车!</span><div class=\"tuichu\"><a href=\"/logout\">退出</a></div></div>";
                con = con.FormatValue(text);
            }
            return Content(con, MimeCollection.Js.ContentType);
        }

前端调用

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

 

后台写js

标签:style   blog   http   io   ar   color   sp   java   for   

原文地址:http://www.cnblogs.com/llxy/p/4125755.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!