Click here to Skip to main content
15,904,348 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hi there...i'm having some problem in login where when i login as user,it entered in user's main page and once i logged out and login as admin,it entered the member's page and again i need to click on the admin site which the tab is on the top and it redirect to login page and the second time when i login use admin passwrd,it entered to admin site.The same goes to the staff site.There are 3 roles in this website which is Admin,User and Staff.Is there anyone can help me i'll be glad.Here i'll provide the aspx and vb code which is running behind.please help me.thanks

ASPX
XML
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" title="Welcome To 7-Eleven website" %>

<%@ Register assembly="FlashControl" namespace="Bewise.Web.UI.WebControls" tagprefix="Bewise" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style9
        {
            color: #000000;
        }
        .style10
        {
            color: #FF0000;
            font-family: Algerian;
            font-size: medium;
        }
        .style8
        {
            color: #006600;
            font-family: Algerian;
            font-size: medium;
        }
        .newStyle1
        {
            font-family: Algerian;
            font-size: medium;
        }
        .newStyle2
        {
            font-family: Algerian;
            font-size: medium;
        }
        .newStyle3
        {
            font-family: Algerian;
            font-size: medium;
            font-weight: bold;
        }
        .style11
        {
            font-size: large;
        }
        .style12
        {
            color: #000000;
            font-family: Algerian;
            font-size: medium;
        }
        </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        &nbsp;
        <asp:Image ID="Image1" runat="server" ImageUrl="~/pix/7-11 logo.jpg"
            Height="98px" Width="121px" /><br />
        </p>
    <p>
        &nbsp;</p>
    <p>
        <strong>

        <span class="style11">&nbsp;</span>

        <span class="style10">7</span><span style="color: #333300"><span
            class="style12">-</span></span><span class="style8">Eleven...</span><span class="newStyle1"><span class="style9">your
        only 24/7 Operating outlet </span></span></strong></p>
    <p>
        <strong>

        <span style="color: #333300"><span
            style="font-size: 14pt; " class="style9"><br />
                        </span></span></span></span></span></span>
<html>

<body>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/
cabs/flash/swflash.cab#version=6,0,40,0"

width="800"
 id="7eleven" style="height: 120px">

<param name="movie"

value="7eleven" />

<param name="quality" value="high" />

<param name="bgcolor" value="#ffffff" />

<embed src="pix/7-eleven.swf" quality="high" bgcolor="#000000"

width="800" height="300"

name="7eleven" align="" type="application/x-shockwave-flash"

pluginspage="http://www.macromedia.com/go/getflashplayer">


</embed>

</object>

</body>

</html> </strong></p>
    <p>
    <br class="style9" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Image ID="Image3" runat="server" ImageUrl="~/pix/7ELEVEN copy.jpg"
            Width="264px" />
    <br />
    <asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8"
        BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana"
        Font-Size="0.8em" ForeColor="#333333"
        DestinationPageUrl="~/MainPage.aspx" style="text-align: center" Height="171px"
                    Width="266px"  VisibleWhenLoggedIn="True">
        <TextBoxStyle Font-Size="0.8em" />
        <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
            BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" />
        <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
        <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em"
            ForeColor="White" />

    </asp:Login>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

        </p>
    <p>
        &nbsp;</p>
    <p style="text-align: center">
           <!-- begin embedded Flash file... -->


        <!-- ...end embedded Flash file -->
       </table>
&nbsp;</p>
    <p style="text-align: center">
        <asp:LinkButton ID="LinkButton1" runat="server" Font-Size="16pt"
            PostBackUrl="~/Register.aspx">Register</asp:LinkButton>
        &nbsp;</p>
    <p style="text-align: center">
        &nbsp;<asp:Image ID="Image2" runat="server" Height="156px" ImageUrl="~/pix/banner.png"
            Width="726px" /><br />
        <span style="font-size: 10pt; color: #000000">© 2011 7-Eleven Malaysia Sdn.Bhd. | All rights reserved |</span><br />
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
</asp:Content>




VB CODE
VB
Partial Class Login

    Inherits System.Web.UI.Page

End Class
Posted
Comments
Sergey Alexandrovich Kryukov 8-Nov-11 11:34am    
Not clear; a big code dump with a vague explanation of the problem.
--SA
aveenxionz 8-Nov-11 12:43pm    
What i mean is when i login as user i can straight away enter to the user's website's main page but when i logged out and enter as admin it still redirect to the user's main page.I have to log out again and enter admin passwrd then only it can enter in admin site.The same goes to the staff site.The asp code is from the main login page and the vb code is the code which is running behind the main login page.Is there any solution that once the admin or staff enter the password it can redirect to the admin or the staff site not to the user's main page?
[no name] 8-Nov-11 17:21pm    
You don't need to dump all of the markup, only what is absolutley necessary. Showing the styles and embedded flash objects has no bearing on the question and is distracting.

1 solution

You need to handle the LoggedIn event of the Login control and redirect as necessary.
 
Share this answer
 
Comments
aveenxionz 9-Nov-11 2:56am    
can i know how to do that because i'm kinda confused and what i get to know is i have to use if else clause to redirect either to user,admin or staff.is there any if else clause i have to apply there and can you attach the code that i can merge either in the vb code which is runnin behind or the aspx code?
[no name] 9-Nov-11 3:24am    
Try something then ask a specific question about what you don't understand

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900