Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2004, 05:34 PM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forms authentication with credentials

Hi guys,
   Recently I bought Pro ASP.net. I am studying forms authentication. Please help me if anyone can solve this problem , i copied exactly code from book to my website for web.config:
<configuration>
<system.web>
  <authentication mode="Forms">
    <forms name="MyApp" path="/" loginUrl="login.aspx"
           protection="All" timeout="10">
      <credentials passwordFormat="Clear">
        <user name="billjones" password="test" />
        <user name="marthasmith" password="test" />
        <user name="joesoap" password="test" />
      </credentials>
    </forms>
  </authentication>

  <authorization>
    <allow users="billjones,marthasmith,joesoap" />
    <deny users="?" />
  </authorization>

</system.web>
</configuration>

and login.aspx below

<%@Page Language="VB" %>
<html>
<head>
<title>Login Form</title>
<style type="text/css">
body, input {font-family:Tahoma,Arial,sans-serif; font-size:10pt }
</style>
</head>
<body>
<form runat="server">
  UserName: <input id="txtUsr" type="text" runat="server" /><p />
  Password: <input id="txtPwd" type="password" runat="server" /><p />
  <ASP:CheckBox id="chkPersist" runat="server" />
  Remember my credentials<p />
  <input type="submit" value="Login" runat="server" onserverclick="DoLogin" /><p />
  <div id="outMessage" runat="server" />
</form>
</body>
</html>

<script language="VB" runat="server">
Sub DoLogin(objSender As Object, objArgs As EventArgs)

  If FormsAuthentication.Authenticate(txtUsr.Value, txtPwd.Value) Then
     FormsAuthentication.RedirectFromLoginPage(txtUsr.V alue, chkPersist.Checked)
  Else
     outMessage.InnerHtml = "<b>Invalid credentials</b> please re-enter..."
  End If

End Sub
</script>
after i use username and password to logon my secure page. there alway has some "!!" followed my others.aspx pages.I can't figure out what's wrong with these code. Thanks all


 
Old September 7th, 2004, 09:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

OK- you need to explain the problem your having a little better- I don't follow what your talking about here.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old September 7th, 2004, 12:31 PM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Hal Levy,
   Thanks for your response. My problem is my login.aspx and others.aspx have some "!!" followed on each page. if you go to my website www.kinwaiusa.com, then click DEALER,which link to login.aspx page. you will see some exclamation mark "!" u\psside-down on theses .aspx page.(you can use id "ben" and password"1234" to login. i copy exactly codes from asp.net 1.1 book to learn form authentication. I don't know why have that kind of things on. Please help me. Thanks a lot

Jerry




Quote:
quote:Originally posted by Hal Levy
 OK- you need to explain the problem your having a little better- I don't follow what your talking about here.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old September 7th, 2004, 12:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I see what you mean now.

If you look at the source code "View Source" you can see that the ¡ marks are there in the source. I am wondering if you have some kind of extended character in your login.aspx page. IN the actual HTML rather than in the code-behind.



Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old September 7th, 2004, 01:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I saw this:



near this:

<a href="index.htm">KinwaiUSA.com</a>
      | <a href="help.htm">Help </a>

Also, instead of using all the &nbsp; you can 'center' the above line.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms Authentication thetway Classic ASP Basics 1 August 18th, 2005 05:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.