Postback jumps to different page

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?
 
A

andrei

Hi John,

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

Andrei.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top