Postback jumps to different page

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Postback jumps to different page

    Hi

    Suppose this page is currently loaded: [url]http://localhost/myapp/?page=news[/url]

    Default.aspx in the Myapp folder will then include /news/default.aspx.

    In the file /news/default.aspx there is a <asp:button> that triggers
    Sub_MyClick. But instead of reloading the same page
    ([url]http://localhost/myapp/?page=news[/url]), it jumps to
    [url]http://localhost/myapp/news/default.aspx[/url].

    How to prevent this? I've tried to add the following code to global.asax...

    Sub Application_EndRequest(Sender As Object, e As EventArgs)
    If Request.IsAuthenticated And Request.Filepath <> "/myapp/Default.aspx"
    And IsNothing(Request.Form("__VIEWSTATE")) = False Then Response.Redirect
    (request.urlreferrer.absoluteuri)
    End Sub

    ....but that only created other problems.

    Anyone?


    John Knoop Guest

  2. Similar Questions and Discussions

    1. spry menubar jumps to top of page
      i've seen this in a few different forums but so far no decent fixes. basically in ie7, the dropdown menus pop to the top of the page. here's the...
    2. Contribute 4 Editing, when typing page jumps to top ofpage
      When in the Dreamweaver like edit mod after clicking the edit button I go to enter some text and the focus of the page goes straight to the top...
    3. How do you do <a> jumps in a Cold Fusion page
      I am trying to do page jumps, for a FAQ on a Cold Fusion page. I wanted to use the old tried and true method of <a> jumps to topics within the...
    4. Update page without postback
      Hi all! I´ve heard about someone that used webservice to get around postback everytime a button or something is pushed. Someone who have tried...
    5. File upload and page PostBack.
      In my project I am uploading file using File control. After browsing file user needs to select other values from DropdownList to determine...
  3. #2

    Default Postback jumps to different page

    hi

    first let me know is this correct?
    [url]http://localhost/myapp/?page=news[/url]. /?page=news how this
    will come.

    regards

    G.Venkat
    >-----Original Message-----
    >Hi
    >
    >Suppose this page is currently loaded:
    [url]http://localhost/myapp/?page=news[/url]
    >
    >Default.aspx in the Myapp folder will then
    include /news/default.aspx.
    >
    >In the file /news/default.aspx there is a <asp:button>
    that triggers
    >Sub_MyClick. But instead of reloading the same page
    >([url]http://localhost/myapp/?page=news[/url]), it jumps to
    >[url]http://localhost/myapp/news/default.aspx[/url].
    >
    >How to prevent this? I've tried to add the following
    code to global.asax...
    >
    >Sub Application_EndRequest(Sender As Object, e As
    EventArgs)
    > If Request.IsAuthenticated And Request.Filepath
    <> "/myapp/Default.aspx"
    >And IsNothing(Request.Form("__VIEWSTATE")) = False Then
    Response.Redirect
    >(request.urlreferrer.absoluteuri)
    >End Sub
    >
    >....but that only created other problems.
    >
    >Anyone?
    >
    >
    >.
    >
    venkat Guest

  4. #3

    Default Re: Postback jumps to different page

    [url]http://localhost/myapp/?page=news[/url] is the same as
    [url]http://localhost/myapp/default.aspx?page=news[/url]

    /john

    "venkat" <senthil_venkat@hotmail.com> wrote in message
    news:097c01c33c72$473af3d0$a101280a@phx.gbl...
    > hi
    >
    > first let me know is this correct?
    > [url]http://localhost/myapp/?page=news[/url]. /?page=news how this
    > will come.
    >
    > regards
    >
    > G.Venkat
    > >-----Original Message-----
    > >Hi
    > >
    > >Suppose this page is currently loaded:
    > [url]http://localhost/myapp/?page=news[/url]
    > >
    > >Default.aspx in the Myapp folder will then
    > include /news/default.aspx.
    > >
    > >In the file /news/default.aspx there is a <asp:button>
    > that triggers
    > >Sub_MyClick. But instead of reloading the same page
    > >([url]http://localhost/myapp/?page=news[/url]), it jumps to
    > >[url]http://localhost/myapp/news/default.aspx[/url].
    > >
    > >How to prevent this? I've tried to add the following
    > code to global.asax...
    > >
    > >Sub Application_EndRequest(Sender As Object, e As
    > EventArgs)
    > > If Request.IsAuthenticated And Request.Filepath
    > <> "/myapp/Default.aspx"
    > >And IsNothing(Request.Form("__VIEWSTATE")) = False Then
    > Response.Redirect
    > >(request.urlreferrer.absoluteuri)
    > >End Sub
    > >
    > >....but that only created other problems.
    > >
    > >Anyone?
    > >
    > >
    > >.
    > >

    John Knoop Guest

  5. #4

    Default Re: Postback jumps to different page

    Hi John,

    Try putting this line in your <head> section of the "news" page:
    <base target="_self">

    Andrei.


    "John Knoop" <john.k@home.se> wrote in message
    news:OeGBPlGPDHA.2284@TK2MSFTNGP11.phx.gbl...
    > Hi
    >
    > Suppose this page is currently loaded: [url]http://localhost/myapp/?page=news[/url]
    >
    > Default.aspx in the Myapp folder will then include /news/default.aspx.
    >
    > In the file /news/default.aspx there is a <asp:button> that triggers
    > Sub_MyClick. But instead of reloading the same page
    > ([url]http://localhost/myapp/?page=news[/url]), it jumps to
    > [url]http://localhost/myapp/news/default.aspx[/url].
    >
    > How to prevent this? I've tried to add the following code to
    global.asax...
    >
    > Sub Application_EndRequest(Sender As Object, e As EventArgs)
    > If Request.IsAuthenticated And Request.Filepath <>
    "/myapp/Default.aspx"
    > And IsNothing(Request.Form("__VIEWSTATE")) = False Then Response.Redirect
    > (request.urlreferrer.absoluteuri)
    > End Sub
    >
    > ...but that only created other problems.
    >
    > Anyone?
    >
    >

    andrei Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139