title: Redirect Page after Login in asp.net 4.0
body: <pre><code>var ur = from user in model.users
                           where user.EmailId == UserName.Text &amp;&amp; user.Password == password
                                 &amp;&amp; user.Active == true
                           select user;
                  if (ur != null &amp;&amp; ur.Count() &gt; 0)
                  {
                      var userData = ur.FirstOrDefault();
                      Session["UserId"] = userData.UserId;
                      Session["UserType"] = userData.UserType;
                      Session["Name"] = userData.FirstName + " " + userData.LastName;
                      Response.Redirect("~/Account/Index.aspx");  
                  }
  </code></pre>
  
  <p>in Web.config 
  authentication mode="Forms"</p>
  
  <p>forms loginUrl="~/Account/Login.aspx" defaultUrl="~/Account/Index.aspx" </p>
  
  <p>authentication</p>
  
  <p>But I entered correct email and password but broswer url change to </p>
  
  <p><a href="http://localhost:49768/Account/Login.aspx?ReturnUrl=%2fAccount%2fIndex.aspx" rel="nofollow">http://localhost:49768/Account/Login.aspx?ReturnUrl=%2fAccount%2fIndex.aspx</a></p>