Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 June 21st, 2006, 12:43 PM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default login control problem (asp.net2.0 website progr..)

hallo,

i bought the book: asp.net 2.0 website programming by marco bellinaso, i have to admit that i come from the classical ASP and do not have very much idea about asp.net.

i'm now kind of stuck at chapter 4, that is i've done my custom login control in the masterpage (adapted to my needs) with following code:

Code:
<div id="login">
            <asp:LoginView ID="LoginView1" runat="server">
                <AnonymousTemplate>
                    <asp:Login ID="Login" runat="server" FailureAction="RedirectToLoginPage">
                        <LayoutTemplate>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td>Benutzer:</td>
                                    <td><asp:TextBox ID="UserName" runat="server" CssClass="logininput"></asp:TextBox></td>
                                    <td align="right"><asp:RequiredFieldValidator ID="valRequiredUserName" runat="server" SetFocusOnError="true" Text="*" ControlToValidate="UserName" ValidationGroup="Login"></asp:RequiredFieldValidator></td>
                                </tr>
                                <tr>
                                    <td>Passwort:</td>
                                    <td><asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="logininput"></asp:TextBox></td>
                                    <td align="right"><asp:RequiredFieldValidator ID="valRequiredPassword" runat="server" SetFocusOnError="true" Text="*" ControlToValidate="Password" ValidationGroup="Login"></asp:RequiredFieldValidator></td>
                                </tr>
                            </table>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td><asp:CheckBox ID="RemeberMe" runat="server" Text="merken" /></td>
                                    <td align="right"><asp:ImageButton ID="Submit" runat="server" CommandName="Login" ValidationGroup="Login" /></td>
                                    <td align="right">&nbsp;</td>
                                </tr>
                            </table>
                            <div style="border-top:solid 1px black; margin-top:2px">
                                <asp:HyperLink ID="lnkRegister" runat="server" NavigateUrl="~/Register.aspx">registrieren</asp:HyperLink><br />
                                <asp:HyperLink ID="lnkPasswordRecovery" runat="server" NavigateUrl="~/PasswordRecovery.aspx">Passwort vergessen?</asp:HyperLink>
                            </div>
                        </LayoutTemplate>
                    </asp:Login>
                </AnonymousTemplate>
                <LoggedInTemplate>
                    <div id="welcomebox">
                        <asp:LoginName ID="LoginName1" runat="server" FormatString="Hallo  {0}!" /><br />
                        <asp:HyperLink ID="lnkProfile" runat="server" Text="Profil ändern" NavigateUrl="~/EditProfile.aspx"></asp:HyperLink>
                        <asp:LoginStatus ID="LoginStatus1" runat="server" />
                    </div>
                </LoggedInTemplate>
            </asp:LoginView>        
        </div>
my web.config is configured like this:

Code:
    <system.web>
    <authentication mode="Forms">
      <forms name="WAFORMAUTH" loginUrl="~/AccessDenied.aspx" defaultUrl="~/Default.aspx"
         requireSSL="true" cookieless="AutoDetect" />
    </authentication>
    <roleManager enabled="true" cacheRolesInCookie="true" cookieName="WAROLES"/>
    <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" decryption="Auto" validation="SHA1"></machineKey>
    <pages enableViewStateMac="true" viewStateEncryptionMode="Always" theme="standard" masterPageFile="~/Template.master" />
<compilation debug="true"/>
</system.web>
and in my AccessDenied.aspx i've got this stuff like error messages. i've also created a new user with the wright permissions and rights, but the problem is: i always get to the AccessDenied.aspx which is telling me about my false credentials, so i can't log in. so the code i'm using is very similar to the book (which i've read until page 152, where the userprofil control is described)...

can anyone tell me waht i'm doing wrong, or give me a hint
 
Old June 22nd, 2006, 09:25 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what a f***k, i forgot to add the asp.net machine account on the filesystem and give at least permission to modify...

if you debug the project on filesystem everything works, if you configure the project to run over iis/localhost, you have to give permission to write to the db (asp.net machine account)....:(...

now everything is working fine:D





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with chapter 3 of Beginning ASP.NET2.0 C# hedgracer ASP.NET 2.0 Basics 1 April 26th, 2008 08:49 AM
crystal report 10 in asp.net2.0,,designing problem niranjana ASP.NET 2.0 Professional 0 November 20th, 2007 01:17 PM
asp.net login control kulkarnimonica ASP.NET 2.0 Professional 6 September 25th, 2007 05:22 PM
ASp.net 2.0 login name control kulkarnimonica ASP.NET 2.0 Professional 12 July 11th, 2007 12:42 AM





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