how to redirect to default page on logout

i have a masterpage which contains loginstatus control

<asp:LoginStatus ID="LoginStatus1" runat="server" 
                     LogoutAction="Redirect" LogoutPageUrl="Default.aspx" />

now on logout click i want to redirect the page to default.aspx but it is not working

Answers


I've been playing around with the login controls recently too and the only difference between what I have and yours is the "~/" in the logoutpageurl property. So try this;

<asp:LoginStatus ID="LoginStatus1" runat="server" 
     LogoutAction="Redirect"
     LogoutPageUrl="~/Default.aspx" />

Hope this helps.


Try placing this in your web.config file.

<location path="default.aspx">  
  <system.web>  
    <authorization>  
      <allow users="*"/>  
    </authorization>  
  </system.web>  
</location>

you can just use the logoutAction attribute and set it to redirectToLoginPage

<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="RedirectToLoginPage" />

that's suppose that in your web.config you add :

<forms loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx" />

the logout action will redirect you then to the loginUrl.

if you want to redirect to specific url you set logoutAction to redirect and you specify whatever url you want.


Need Your Help

Docker npm install fails

node.js docker npm npm-install

I'm trying to build an ASP.Net 5.0 web app using Docker, but it fails when it reaches the npm install step, with:

Can someone look at my Bootstrap Switch onSwitchChange. It does not work

javascript jquery twitter-bootstrap

Not sure what i am doing wrong here other than i am very weak in JQuery. The code in my onSwitchChange is not working. If i were to change it and put in alert("something"), it fires the alert, so i