日期:2014-05-18  浏览次数:20433 次

登录模块中登录后不能正确返回的问题.
我实际是修改一个网站.在网站首页的左边有登录框,右边是网站内容.用首页这个登录,可正常登录,用户会进入自己的账户,即转到一个新页面,左边的登录框变成用户功能.比如用户信息,用户功能,用户退出等等的.

但如果密码错误,页面就会转到一个新的登录页面.本来这个新登录页面中,如果用户密码都正确,就只能用Label控件提示登录成功四个字.我要改的是,在登录成功后,把页面转到前面所说的用户账户页面,就跟首页登录框成功登录后一样.于是我把首页的登录按钮对应的函数代码--就两行--写到了新登录页面中的登录按钮对应的函数中.其它我不懂,就没改.

代码是:
ACard.CUser.UserLogin(Session[ "username "].ToString(),DropDownList_Cookie.Text.Trim(),     null,     true);    
  Response.Redirect( "Left.aspx ");    

letf.aspx是登录后转到的用户个人账户页面.就是提示用户已经登录,用户的个人信息,用户可用的操作等.

在运行程序后,我在新登录页面中填写用户名和密码后进行登录,这时就出错了.错误的提示是:
Sys.WebForms.PageRequestManagerParserErrorException:   The   message   received   from   the   server   could   not   be   parsed.   Common   causes   for   this   error   are   when   the   response   is   modified   by   calls   to   Response.Write(),   response   filters,   HttpModules,   or   server   trace   is   enabled.   Details:   Error   parsing   near   '  
<!DOCTYPE   html   P '.    

我把其中的response.redirct();注释掉,就没有错误提示了.我也不知道是不是这句的错误.首页的登录中为什么能用?还有前面的那句代码,我也不知道做什么用的.首页的登录页面和这个新登录页面的代码中还有这几句不一样的:

<head>
<title> 无标题文档 </title>
        <link   href= "../ASP_Code/css/common.css "   rel= "stylesheet "   type= "text/css "   />
        <link   href= "../ASP_Code/css/mainrightDefault.css "   rel= "stylesheet "   type= "text/css "   />
        <link   href= "../ASP_Code/css/foodlib.css "   rel= "stylesheet "   type= "text/css "   />
        <link   href= "../ASP_Code/css/left.css "   rel= "stylesheet "   type= "text/css "   />
</head>

<script   type= "text/javascript "   src= "js/common.js "> </script>

我不知道做什么的   也不知道是不是因为新登录页面没这些代码所以出错.但我全拷过来,更直接不行.提示这几句错误.   到底是哪出错了呢?

------解决方案--------------------
up
------解决方案--------------------
你换了代码后有生成网站吗?
难道没提示错误?
------解决方案--------------------
try:

Response.Redirect( "Left.aspx ",true);