We are working on forms authentication in ASP.NET and we do not want the user to have to click the Submit button. We are having trouble making it auto-click to allow the user in the code to go in. It works just fine if they click it, but we want it to auto click. Any suggestions?
Here is the code we have...
<%@ Page Language="VB" Debug="true" %>
<%@Import Namespace="System.Web.Secu
rity" %>
<script language="vb" runat="server">
Sub ProcessLogin(objSender As Object, objArgs As EventArgs)
If FormsAuthentication.Authen
ticate(txt
User.Text,
txtPassword.Text) Then
FormsAuthentication.Redire
ctFromLogi
nPage(txtU
ser.Text, false)
Else 'if no authentication, send to login page
response.redirect("
http://www.foo.net")
End If
End Sub
</script>
<html>
<head>
<title></title>
</head>
<body>
You are at the login page (login.aspx) of the Secure site.<br>
<br>
I'm working on making this page "invisible" - automatically logging into the secure site.<br>
<br>
Just click the Login button (below) to go on into the secure site.<br>
<form name="go_in" runat="server">
<asp:TextBox Visible="false" id="txtUser" runat="server" width="100" Text="jim"></asp:TextBox>
<asp:TextBox Visible="false" id="txtPassword" runat="server" width="100" Text="greetings"></asp:Tex
tBox>
<asp:Button id="Login" onclick="ProcessLogin" runat="server" Text="Login"></asp:Button>
</form>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("g
o_in").sub
mit()
}
</script>
</head><body>
<form name="go_in" runat="server" defaultbutton="Login">