C
Chuck
I want to open the FormsAuthentication Logon Page using javascript, not a
Response.Redirect.
I can't get it to work. If I have the onclick Javascript read window.open,
it works fine. If I use window.location or window.location.href it does not.
<asp:Button ID="btnLogOut" runat="server" Text="Log Out" />
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False">LinkButton</asp:LinkButton>
btnLogOut.Attributes.Add("onclick","window.location.href('"+
FormsAuthentication.LoginUrl + "?logout=true'); return false;");
LinkButton1.PostBackUrl=(FormsAuthentication.LoginUrl + "?logout=true");
The linkButton does work the regular button does not.
<input type="submit" id="ctl00_ContentMain_btnLogOut"
onclick="window.location.href('http://localhost/HRAuth/LogIn.aspx?logout=true'); return false;" value="Log Out" name="ctl00$ContentMain$btnLogOut">
<a href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$ContentMain$LinkButton1", "", false, "",
"http://localhost/HRAuth/LogIn.aspx?logout=true", false, true))"
id="ctl00_ContentMain_LinkButton1">LinkButton</a>
Response.Redirect.
I can't get it to work. If I have the onclick Javascript read window.open,
it works fine. If I use window.location or window.location.href it does not.
<asp:Button ID="btnLogOut" runat="server" Text="Log Out" />
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False">LinkButton</asp:LinkButton>
btnLogOut.Attributes.Add("onclick","window.location.href('"+
FormsAuthentication.LoginUrl + "?logout=true'); return false;");
LinkButton1.PostBackUrl=(FormsAuthentication.LoginUrl + "?logout=true");
The linkButton does work the regular button does not.
<input type="submit" id="ctl00_ContentMain_btnLogOut"
onclick="window.location.href('http://localhost/HRAuth/LogIn.aspx?logout=true'); return false;" value="Log Out" name="ctl00$ContentMain$btnLogOut">
<a href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$ContentMain$LinkButton1", "", false, "",
"http://localhost/HRAuth/LogIn.aspx?logout=true", false, true))"
id="ctl00_ContentMain_LinkButton1">LinkButton</a>