public ActionResult RepwdEdit(Guid id)
        {
            var db = new aspnetdbEntities();
            var model = db.aspnet_Membership.Where(p => p.UserId == id).FirstOrDefault();
            MembershipUser user = Membership.GetUser(model.aspnet_Users.UserName);
            if (user.IsLockedOut)
            {
                user.UnlockUser();
            }
            StringBuilder strhtml = new StringBuilder();
            strhtml.Append("<li>");
            strhtml.Append("原始密码:<input type='password' id='oldpwd' value='" + user.UserName + "'/>");//user.ResetPassword()
            strhtml.Append("输入新密码:<input type='password' id='newpwd1'/>");
            strhtml.Append("请重复密码:<input type='password' id='newpwd2'/>");
            strhtml.Append("<input type='button' id='btnok'/>");
            strhtml.Append("</li>");
            //string password = user.ResetPassword(); //修改密码
            //user.ChangePassword(password, "111111"); //用指定的密码设置
            //return RedirectToAction("Index");
            return View(strhtml.ToString());
        } <td>
                    <%: Html.ActionLink("角色", "Edit","UserInRoles", new { id = item.UserId,name=item.aspnet_Users.UserName , height = 560, width = 700, TB_iframe = "True", keepThis = "False" }, new { @class = "thickbox" })%>
                    |
                    <%: Html.ActionLink("解锁", "Unlock", new { id = item.UserId }, new { onclick = "return confirm('是否解锁此用户?')" })%>
                    |
                    <%: Html.ActionLink("密码修改", "RepwdEdit", new { id = item.UserId , height = 560, width = 700, TB_iframe = "True", keepThis = "False" }, new { @class = "thickbox" })%>
                </td>

解决方案 »

  1.   

      var model = db.aspnet_Membership.Where(p => p.UserId == id).FirstOrDefault();
    是不是你这里有问题,里面的符号
        >=   ??   >=
      

  2.   

     上面会有上面问题? 我就想返回一个段html啊 
      

  3.   

    View("视图") 字符串是 视图名字 路径, sb转成object, 或者返回 Content("");
      

  4.   

    ViewBag.Content = strhtml.ToString();
    return View();
      

  5.   


    或者:
          Response.Write(strhtml.tostring());
          Response.End();
          return View();
      

  6.   

    好了! 太谢谢了  应该return View();视图的  呵呵 
      

  7.   

    View(strhtml.ToString())
    它把strhtml.ToString()当成是url路径了,当然会报错了