Postbackurl Intermittently Working

Discussion in 'ASP .Net' started by Jeremy Olmstead, Aug 9, 2007.

  1. I have a page that uses a button with attribute postbackurl set to a
    different page. The page that it posts to is in a different directory
    that is secured via forms authentication. When it's clicked sometimes it
    works by redirecting to the login in page, but it usually doesn't. The
    page that comes up in Firefox basically says "The connection to the
    server was reset while the page was loading". In Internet Explorer I get
    a similar error, but if I refresh the page it works by redirecting to the
    login page every time. Refreshing does not always work in Firefox but it
    does sometimes. Also if I try to start debugging right from the protected
    file /members/checkout.aspx it correctly redirects to the log in page.
    Any idea what I could be doing wrong? Some relevant code below...

    Button Definition
    -----
    <asp:Button ID="checkOutButton" runat="server" CssClass="myButton"
    Text="Check Out" PostBackUrl="~/members/checkout.aspx" />
    -----

    Relevant web.config Section
    -----
    <system.web>
    <authentication mode= "Forms">
    <forms name=".ASPXAUTH" loginUrl="~/login.aspx" protection="All" />
    </authentication>
    </system.web>

    <location path="members">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    -----

    checkout.aspx
    -----
    <%@ Page Language="VB" AutoEventWireup="false"
    CodeFile="checkout.aspx.vb" Inherits="members_checkout" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>

    </div>
    </form>
    </body>
    </html>
    -----

    checkout.aspx.vb
    -----
    Partial Class members_checkout
    Inherits System.Web.UI.Page

    End Class
    -----
    Jeremy Olmstead, Aug 9, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rubble
    Replies:
    3
    Views:
    718
    Alvin Bruney [MVP]
    Mar 5, 2004
  2. Uriah Piddle

    PostBackUrl Not Working

    Uriah Piddle, Feb 26, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    2,513
    Uriah Piddle
    Feb 27, 2007
  3. chrisexv6
    Replies:
    2
    Views:
    356
    chrisexv6
    Apr 22, 2007
  4. Fabio Mastria
    Replies:
    2
    Views:
    2,538
  5. chrisexv6

    Web services stop working intermittently.....

    chrisexv6, Apr 21, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    114
    chrisexv6
    Apr 21, 2007
Loading...

Share This Page