Postback jumps to different page

  • Thread starter Thread starter John Knoop
  • Start date Start date
J

John Knoop

Hi

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

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
(http://localhost/myapp/?page=news), it jumps to
http://localhost/myapp/news/default.aspx.

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?
 
Hi John,

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

Andrei.
 
Back
Top