473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VB Login Page Problem

Okay...
Using vb .net within DW MX2004, connecting to an access database:

Background: I have created a simple login.aspx page that is supposed to
re-direct to default.aspx using FormsAuthentication.RedirectFromLoginPage.
The data is correct from testing the dataset etc and the page also informs
me that I have entered an incorrect user / password.

Problem:
When I go to http://localhost/Modify/Login.aspx and enter the username and
password the url returns
http://localhost/Modify/login.aspx?R...2fdefault.aspx and
does not take me to any other page???

Code:
WEB.CONFIG:

<system.web>
<customErrors mode="Off" />
<authentication mode = "Forms">
<forms name = " .SECAUTH " loginUrl="login.aspx">
<credentials />
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>

LOGIN PAGE:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral"
%>
<MM:DataSet
id="dsLogin"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_connITNoticeboardASP")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_connITNoticeboard ASP")
%>'
CommandText='<%# "SELECT EmployeeID, LastLogin, User_name, Pass_wrd FROM
tbl_users WHERE User_name = ? AND Pass_wrd = ?" %>'
Debug="true"
<Parameters>

<Parameter Name="@User_name" Value='<%# IIf((Request.Form("tfUsername")
<> Nothing), Request.Form("tfUsername"), "") %>' Type="WChar" />
<Parameter Name="@Pass_wrd" Value='<%# IIf((Request.Form("tfPasswrd") <>
Nothing), Request.Form("tfPasswrd"), "") %>' Type="WChar" />
</Parameters></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Login Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
..style1 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<p align="center" class="style1">Login Page</p>
<p>&nbsp;</p>
<table width="300" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td><form runat="server">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="98">Username:</td>
<td width="202"><asp:TextBox ID="tfUsername" runat="server"
/></td>
</tr>
<tr>
<td>Password:</td>
<td><asp:TextBox ID="tfPasswrd" runat="server" TextMode="Password"
/></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Button ID="Button" Text="Login" runat="server" /></td>
</tr>
</table>
</form></td>
<%
if dsLogin.RecordCount > 0 then
Session("sessUsername") = Request.Form("tfUsername")
FormsAuthentication.RedirectFromLoginPage("tfUsern ame.value", true )
else if ((Request.Form("tfUsername"))) <> Nothing OR
((Request.Form("tfPassword"))) <> Nothing
response.Write("Login Failed. Please Try Again.")
end if
%>
</tr>
</table>
<table width="300" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td><p align="center"><a href="http://www.yahoo.com"
target="_parent">www.yahoo.com</a></p>
<p align="center"><a href="../search_it.aspx" target="_parent">Start
Page</a> </p></td>
</tr>
</table>
<p>&nbsp; </p>
</body>
</html>
Nov 19 '05 #1
3 2312
Is your Default.aspx page secured against anonymous users in
Web.Config? If so, just hit that page directly...users will be
temporarily redirected to the Login.aspx page but then immediately
returned to Default.aspx upon successfully logging in.

If Default.aspx is open to anonymous users, you can always include log
in functionality (user name and password textboxes, log in button with
code-behind, etc...) directly on that page.

I am sure there are many other solutions...

JP>

Nov 19 '05 #2
Thanks!

Will give this a go

<jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is your Default.aspx page secured against anonymous users in
Web.Config? If so, just hit that page directly...users will be
temporarily redirected to the Login.aspx page but then immediately
returned to Default.aspx upon successfully logging in.

If Default.aspx is open to anonymous users, you can always include log
in functionality (user name and password textboxes, log in button with
code-behind, etc...) directly on that page.

I am sure there are many other solutions...

JP>

Nov 19 '05 #3

Found what was wrong from the books appended mistakes page while looking on
the web:

forms name = " SECAUTH " loginUrl="login.aspx">
not
forms name = " .SECAUTH " loginUrl="login.aspx">

take out the full stop and it all works.


Dam6 wrote:
Thanks!

Will give this a go

<jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is your Default.aspx page secured against anonymous users in
Web.Config? If so, just hit that page directly...users will be
temporarily redirected to the Login.aspx page but then immediately
returned to Default.aspx upon successfully logging in.

If Default.aspx is open to anonymous users, you can always include
log in functionality (user name and password textboxes, log in
button with code-behind, etc...) directly on that page.

I am sure there are many other solutions...

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike | last post by:
I can not figure out what is going on here. I hope somebody can please help!!! I've got an intranet ASP3 application running on a Win2k server. This application requires a login, so the user...
10
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
7
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms...
4
by: hrawada | last post by:
Hello everyone, I have built a simple website with a simple login page and another page that is the destination page after logging in. The website works fine on my machince however when I...
4
tolkienarda
by: tolkienarda | last post by:
Hi all I work for a small webdesign company and we have remote hosting. i built a mysql database with phpmyadmin on the server. i then downloaded and modified a php login page. i am continuing to...
2
by: =?Utf-8?B?U2hhbm5vbg==?= | last post by:
I am trying to publish an application to a server that I do not have desktop access to because of our hosting environment. I publish to a file share. The WEB site has been configured by the hosts...
1
by: simon2x1 | last post by:
i have two page the login page(login.php) and the userpanel page(userpanel.php) in the login page whenever i put in the username and password then i click submit it will get the userpanel page but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.