Results 1 to 26 of 26

Thread: [VWD 2005] Redirection from login page

  1. #1

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    [VWD 2005] Redirection from login page

    I'm not doing very well here...

    Default.asx displays, user clicks on LoginStatus control, login.aspx displays, user fills in details, user gets returned to default.asps despite presence of DestinationPageUrl="~/MainPage.aspx" in code.

    Default.aspx, login.aspx and mainpage.aspx are all in the same folder.

    I'm clearly doing something very stupid!
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  2. #2
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: [VWD 2005] Redirection from login page

    hi,
    can u figure out your folder solution explorer strucure ....
    Loving dotnet

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    In the LoggedIn event of this Login control is User.Identity.IsAuthenticated = True?

  4. #4

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    No, there's nothing in the code for this event (if I'm looking in the right place:

    Partial Class Default2
    Inherits System.Web.UI.Page

    Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn

    End Sub
    End Class

    And, of course, the app has amazingly now decided to work (but only on the local machine!!!).
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    According to MSDN, you should have it. You are doing this on the page with the Login control, right?


    Code:
    Sub OnLoggedIn(ByVal sender As Object, ByVal e As EventArgs)
        SiteSpecificUserLoggingMethod(Login1.UserName)
    End Sub
    You'll notice that it's looking at Login1.UserName, another point to look at perhaps.

  6. #6

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Thanks. I've looked at the MSDN link and added some of the code to my login.aspx which now looks like this:

    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="Default2" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    Sub SiteSpecificUserLoggingMethod(ByVal UserName As String)
        ' Insert code to record the current date and time
        ' when this user was authenticated at the site.
    End Sub
    
    Sub OnLoggedIn(ByVal sender As Object, ByVal e As EventArgs)
        SiteSpecificUserLoggingMethod(Login1.UserName)
    End Sub
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        <link href="default.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp;<asp:Login ID="Login1" runat="server" style="left: 312px; position: relative; top: 190px" DestinationPageUrl="~/MainPage.aspx">
            </asp:Login>    
        </div>
        </form>
    </body>
    </html>
    This hasn't made any difference - things behave as they should here (ie. mainpage.aspx loads) but on the server completing the login successfully returns me to default.aspx

    BTW, I put a breakpoint on the line
    Code:
    SiteSpecificUserLoggingMethod(Login1.UserName)
    but it wasn't executed (even though the login was successful). Why would that be (or have I misunderstood how debugging works in VWD - I'm only used to VB6)?
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Because you haven't specified whether that event should be hit or not.

    Code:
    <asp:Login ID="Login1" runat="server" style="left: 312px; position: relative; top: 190px" DestinationPageUrl="~/MainPage.aspx" OnLoggedIn="OnLoggedIn">
    </asp:Login>

  8. #8

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Quote Originally Posted by mendhak
    Because you haven't specified whether that event should be hit or not.

    Code:
    <asp:Login ID="Login1" runat="server" style="left: 312px; position: relative; top: 190px" DestinationPageUrl="~/MainPage.aspx" OnLoggedIn="OnLoggedIn">
    </asp:Login>
    But why should I have to? Why isn't it sufficient to set the DestinationPageUrl property? I thought these controls were meant to hide a lot of background code. I can see that the LoggedIn event could be useful for all sorts of things but why does giving DestinationPageUrl a value mean that I have to write extra code for it to work?
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  9. #9

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Quote Originally Posted by mendhak
    In the LoggedIn event of this Login control is User.Identity.IsAuthenticated = True?
    Its value is true on my local machine but I have no idea if it's the same on the remote server (which is where the problem now is, it would seem).
    Is there a way of displaying the value of this property online?
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Quote Originally Posted by paulorton
    But why should I have to? Why isn't it sufficient to set the DestinationPageUrl property? I thought these controls were meant to hide a lot of background code. I can see that the LoggedIn event could be useful for all sorts of things but why does giving DestinationPageUrl a value mean that I have to write extra code for it to work?
    You don't. This is for testing purposes to see if the user does actually log in. A crude way of tracing things.

  11. #11
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Quote Originally Posted by paulorton
    Its value is true on my local machine but I have no idea if it's the same on the remote server (which is where the problem now is, it would seem).
    Is there a way of displaying the value of this property online?
    Yes. Try doing a Response.write of that value, either on the same page or the destination page load event. The 'value' should show up somewhere near the top of the page in an ugly font. Remove it soon afterwards.

  12. #12

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    OK, did that and Response.Write(User.Identity.IsAuthenticated) returned "true".

    In other words the user successfully logs in but the setting of login control's DestinationPageUrl property to "~/MainPage.aspx" isn't working - the user is returned to default.aspx (but only on the remote server - it works fine here).
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Alright, get rid of that testing code you had. So you've now confirmed that the user is in fact logged in on the remote server as well, but the DestinationPageUrl is not respected. Under the <authentication> node in your web.config, you will see a <forms> node. Set a defaultUrl property for it to MainPage.aspx

  14. #14

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Thanks, done that but I'm still redirected to default.aspx

    Just to confirm again, here is the code in login.aspx :
    Code:
    <asp:Login ID="Login1" runat="server" style="left: 312px; position: relative; top: 190px" DestinationPageUrl="~/MainPage.aspx" OnLoggedIn="OnLoggedIn">
            </asp:Login>
    And MainPage.aspx is in the same folder on the server as all the pages I have so far created.
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  15. #15

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Plus I have this (also in login.aspx) :
    Code:
    <script runat="server">
    Sub SiteSpecificUserLoggingMethod(ByVal UserName As String)
        ' Insert code to record the current date and time
        ' when this user was authenticated at the site.
    End Sub
    
    Sub OnLoggedIn(ByVal sender As Object, ByVal e As EventArgs)
        SiteSpecificUserLoggingMethod(Login1.UserName)
    End Sub
    </script>
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  16. #16
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Like you said earlier, you shouldn't need this extra code. We used that to confirm that the user was indeed logged in, and he is.

    So get rid of

    OnLoggedIn="OnLoggedIn"

    and

    Code:
    <script runat="server">
    Sub SiteSpecificUserLoggingMethod(ByVal UserName As String)
        ' Insert code to record the current date and time
        ' when this user was authenticated at the site.
    End Sub
    
    Sub OnLoggedIn(ByVal sender As Object, ByVal e As EventArgs)
        SiteSpecificUserLoggingMethod(Login1.UserName)
    End Sub
    </script>
    Could you do what I mentioned in post 13? In the <forms> node, set the defaultUrl attribute.

  17. #17

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    OK, OnLoggedIn="OnLoggedIn" now deleted and I had already set the DefaultURL property to "MainPage.aspx" - still no joy though...
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  18. #18
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    I'm at a loss here. Wouldn't be possible for you to upload a sample would it? Can you reproduce the issue in a new project?

  19. #19

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    I am using Access for membership data. MainPage.aspx (the page I am not being redirected to) also loads data from an Access database - if that's relevant. Here's all the code I can see that's relevant (there's nothing in the code behinds).

    web.config :
    Code:
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    	<connectionStrings>
    		<add name="ASPNetDB.mdb" connectionString="~\App_Data\ASPNetDB.mdb" providerName="System.Data.OleDb"/>
    	</connectionStrings>
    	<system.web>
        <customErrors mode="Off"/>
    		<authentication mode="Forms">
          <forms loginUrl="Login.aspx" defaultUrl="MainPage.aspx"/>			
    		</authentication>
    		<membership defaultProvider="AccessMembershipProvider">
    			<providers>
    				<clear/>
    				<add name="AccessMembershipProvider"
         type="Samples.AccessProviders.AccessMembershipProvider, ASP.NET Access Providers1"
         connectionStringName="ASPNetDB.mdb"
         enablePasswordRetrieval="false"
         enablePasswordReset="false"
         requiresUniqueEmail="false"
         requiresQuestionAndAnswer="false"
         minRequiredPasswordLength="1"
         minRequiredNonalphanumericCharacters="0"
         applicationName="Carm_FCL"
         hashAlgorithmType="SHA1"
         passwordFormat="Hashed"/>
    			</providers>
    		</membership>
    		<roleManager enabled="true" defaultProvider="AccessRoleProvider" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
    			<providers>
    				<add name="AccessRoleProvider"
         type="Samples.AccessProviders.AccessRoleProvider, ASP.NET Access Providers1"
         connectionStringName="ASPNetDB.mdb"
         applicationName="Carm_FCL"/>
    			</providers>
    		</roleManager>
    		<profile enabled="true" defaultProvider="AccessProfileProvider">
    			<providers>
    				<add name="AccessProfileProvider"
         type="Samples.AccessProviders.AccessProfileProvider, ASP.NET Access Providers1"
         connectionStringName="ASPNetDB.mdb"
         applicationName="Carm_FCL"
         description="Stores and retrieves profile data from an ASP.NET_Access_Providers1 database."/>
    			</providers>
    			<properties>
    				<add name="FriendlyName" type="string" allowAnonymous="true" serializeAs="String"/>
    				<add name="Height" type="int" allowAnonymous="true" serializeAs="String"/>
    				<add name="Weight" type="int" allowAnonymous="true" serializeAs="Xml"/>
    			</properties>
    		</profile>
    		<anonymousIdentification enabled="true" cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="None" domain=""/>
    		<webParts>
    			<personalization defaultProvider="AccessPersonalizationProvider">
    				<providers>
    					<add name="AccessPersonalizationProvider"
          type="Samples.AccessProviders.AccessPersonalizationProvider, ASP.NET Access Providers1"
          connectionStringName="ASPNetDB.mdb"
          applicationName="Carm_FCL"/>
    				</providers>
    			</personalization>
    		</webParts>
    		
            <!--
    		<trust level="Medium"/>
            -->
    		
    		<compilation debug="true"/>
        <pages>
          <namespaces>
            <clear />
            <add namespace="System" />
            <add namespace="System.Collections" />
            <add namespace="System.Collections.Specialized" />
            <add namespace="System.Configuration" />
            <add namespace="System.Text" />
            <add namespace="System.Text.RegularExpressions" />
            <add namespace="System.Web" />
            <add namespace="System.Web.Caching" />
            <add namespace="System.Web.SessionState" />
            <add namespace="System.Web.Security" />
            <add namespace="System.Web.Profile" />
            <add namespace="System.Web.UI" />
            <add namespace="System.Web.UI.WebControls" />
            <add namespace="System.Web.UI.WebControls.WebParts" />
            <add namespace="System.Web.UI.HtmlControls" />
          </namespaces>
        </pages>
    	</system.web>
    </configuration>
    default.aspx :
    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Untitled Page" MasterPageFile="~/MasterPage2.master" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">    
        
            <div>
                <br />
                <br />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                Login view:<br />
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                <asp:LoginView ID="LoginView1" runat="server">
                    <LoggedInTemplate>
                        This view is for people who have
                        <br />
                        logged in.
                    </LoggedInTemplate>
                    <AnonymousTemplate>
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        This view is for people who have not yet logged in.
                    </AnonymousTemplate>
                </asp:LoginView>
                <br />
                &nbsp;&nbsp;<br />
                &nbsp;<br />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                Login status:
            </div>
        &nbsp;<asp:LoginStatus ID="LoginStatus1" runat="server" style="left: 81px; position: relative; top: 4px" />
            <br />
            <br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Login name:<br />
            &nbsp;
            
            <asp:LoginName ID="LoginName1" runat="server" Style="left: 68px; position: relative;
                top: 0px" />       
            &nbsp;
    </asp:Content>
    MainPage.aspx :
    Code:
    <%@ Page Language="VB" MasterPageFile="~/MainPages.master" AutoEventWireup="false" CodeFile="MainPage.aspx.vb" Inherits="MainPage" title="Untitled Page" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <asp:GridView ID="GridView1" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="DateOfWork" HeaderText="DateOfWork" SortExpression="DateOfWork" />
                <asp:BoundField DataField="Worksheet" HeaderText="Worksheet" SortExpression="Worksheet" />
                <asp:BoundField DataField="NumQuestions" HeaderText="NumQuestions" SortExpression="NumQuestions" />
                <asp:BoundField DataField="Try" HeaderText="Try" SortExpression="Try" />
                <asp:BoundField DataField="NumSheets" HeaderText="NumSheets" SortExpression="NumSheets" />
                <asp:BoundField DataField="Errors" HeaderText="Errors" SortExpression="Errors" />
                <asp:BoundField DataField="Percentage" HeaderText="Percentage" SortExpression="Percentage" />
                <asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time" />
                <asp:BoundField DataField="HomeComment" HeaderText="HomeComment" SortExpression="HomeComment" />
                <asp:BoundField DataField="Parent/StudentComment" HeaderText="Parent/StudentComment" SortExpression="Parent/StudentComment" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="Carmarthen.mdb" SelectCommand="SELECT * FROM [M_AamirAbdullah]"></asp:AccessDataSource>
    </asp:Content>
    login.aspx :
    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="Default2" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    Sub SiteSpecificUserLoggingMethod(ByVal UserName As String)
        ' Insert code to record the current date and time
        ' when this user was authenticated at the site.
    End Sub
    
    Sub OnLoggedIn(ByVal sender As Object, ByVal e As EventArgs)
        SiteSpecificUserLoggingMethod(Login1.UserName)
    End Sub
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        <link href="default.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp;<asp:Login ID="Login1" runat="server" style="left: 312px; position: relative; top: 190px" DestinationPageUrl="~/MainPage.aspx" >
            </asp:Login>    
        </div>
        </form>
    </body>
    </html>
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  20. #20

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Tried the following code in default.aspx.vb :

    Code:
    Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
            If User.Identity.IsAuthenticated Then
                Response.Redirect("MainPage.aspx")
            End If
        End Sub
    (If you recall, MainPage is not being loaded after a user logs in and user gets returned to default.aspx).

    This code does indeed attempt to load MainPage but the load fails, flagging a "System.Data.OleDb.OleDbException" (the page has a gridview that loads data from an Access database).

    I don't suppose it's of any use but here is the stack trace :

    Code:
    [OleDbException (0x8000ffff): No error message available, result code: E_UNEXPECTED(0x8000FFFF).]
       System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1059617
       System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
       System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.OleDb.OleDbConnection.Open() +37
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
       System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +74
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       System.Web.UI.WebControls.GridView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +41
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
    Any idea why the gridview isn't working (it does on my local machine)? Could this be the reason why MainPage wasn't loading when I first started this thread?
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  21. #21

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    It's the gridview that's causing all the trouble! If I remove it MainPage loads once the user has logged in.

    Here's the code I was using for it - as I said it works fine here :

    Code:
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <asp:GridView ID="GridView1" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="DateOfWork" HeaderText="DateOfWork" SortExpression="DateOfWork" />
                <asp:BoundField DataField="Worksheet" HeaderText="Worksheet" SortExpression="Worksheet" />
                <asp:BoundField DataField="NumQuestions" HeaderText="NumQuestions" SortExpression="NumQuestions" />
                <asp:BoundField DataField="Try" HeaderText="Try" SortExpression="Try" />
                <asp:BoundField DataField="NumSheets" HeaderText="NumSheets" SortExpression="NumSheets" />
                <asp:BoundField DataField="Errors" HeaderText="Errors" SortExpression="Errors" />
                <asp:BoundField DataField="Percentage" HeaderText="Percentage" SortExpression="Percentage" />
                <asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time" />
                <asp:BoundField DataField="HomeComment" HeaderText="HomeComment" SortExpression="HomeComment" />
                <asp:BoundField DataField="Parent/StudentComment" HeaderText="Parent/StudentComment" SortExpression="Parent/StudentComment" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="Carmarthen.mdb" SelectCommand="SELECT * FROM [M_AamirAbdullah]"></asp:AccessDataSource>
    </asp:Content>
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  22. #22
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Not sure I understand. Had I seen the stacktrace earlier (I just saw it right now), then we'd know that it was indeed database related. How was the gridview causing the problem though?

  23. #23

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Quote Originally Posted by mendhak
    Not sure I understand. Had I seen the stacktrace earlier (I just saw it right now), then we'd know that it was indeed database related. How was the gridview causing the problem though?
    When I started this thread no exception was caused when the user went back to default.aspx instead of to MainPage.aspx - the app just behaved as if everything was working fine. That's why you couldn't understand what was causing the problem.

    The exception is only generated by
    Code:
    Response.redirect ("MainPage.aspx")
    which I only added today in an attempt to try to find another way to get MainPage loaded.
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  24. #24
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    So it wasn't aliens, which was going to be my next suggestion. Thanks for saving me from the embarrassment.

  25. #25

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: [VWD 2005] Redirection from login page

    Do you have any idea what's going wrong with the gridview? I assume it can't talk to the database for some reason...
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  26. #26
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [VWD 2005] Redirection from login page

    Start a new thread about your gridview since you'll be able to get more people answering your brand new gridview question (it being a new thread, new perspective, etc)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width