0

I am using asp.net and i am trying to login from the fancy box. I have code sample like this :

          function (LoginResponse) {
                      $.each(LoginResponse, function () {
                          if (this["IsLogin"] == "true") {
                              window.location.reload(true);
                              window.location.href = "Account/MyProfile.aspx";
                          }
                          else {
                              jAlert('Warning!', 'Invalid login Credintials', 'Please enter valid Username and Password..', 'yellow');
                          }
                          clear_form_elements('#UserLoginSection'); //Clears the element of the form
                      });
                  }
                    );

Some time it goes well with this address "Account/MyProfile.aspx" But some time The Address wrong and in the address bar something like this come again and again "Account/Account/MyProfile.aspx" There should not be Double Account meaning "Account/MyProfile.aspx" should be there. and I have tried to remove Account in the javascript function above But some time it works well but some time it does not. What i have to do please help me.

4

2 回答 2

0

将 location.href 设置为不同的 URL 应该已经重新加载页面。使用 reload 或 location.href,不能同时使用。

于 2013-09-18T04:50:31.443 回答
0

如果您想在登录“MyProfile.aspx”后登陆用户,则使用 window.location.href,或者如果您希望他们在同一页面上,则仅使用 location.reload(true)。无需同时使用两者。

于 2013-09-18T05:04:13.837 回答