473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Postback jumps to different page

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?
Nov 17 '05 #1
3 2392
hi

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

regards

G.Venkat
-----Original Message-----
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 triggersSub_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?
.

Nov 17 '05 #2
http://localhost/myapp/?page=news is the same as
http://localhost/myapp/default.aspx?page=news

/john

"venkat" <se************@hotmail.com> wrote in message
news:09****************************@phx.gbl...
hi

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

regards

G.Venkat
-----Original Message-----
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?
.

Nov 17 '05 #3
Hi John,

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

Andrei.
"John Knoop" <jo****@home.se> wrote in message
news:Oe**************@TK2MSFTNGP11.phx.gbl...
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?

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the...
7
by: moondaddy | last post by:
I'm building a page in vb.net with several user controls on it. I'm using user controls instead of a frames page since I've seen this recommended many times in this user group. I want just one of...
1
by: Ren | last post by:
I am creating a profile page which on load only has the images of each person (as an ImageButton). When the user clicks on a picture, the text of a hidden label is displayed with the text of that...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
5
by: Darrel | last post by:
I'm dimming a string at the top of my page so I can use it in several different subs on the page. I'm setting the text in one sub and then reading it in several. I'd like to also use this...
8
by: walesboy | last post by:
greetings - I have a btnSubmit button with a Handles btnSubmit.click which works great if all the user does is click that button. But, if the user ALSO changes a text box on the page (which...
3
by: Lenard Gunda | last post by:
Hi, I have the following problem. On a page I have a multiple selection listbox. It contains a lot of items. When items near the bottom are selected, and I do a postback, the control jumpst to...
6
by: Shawn | last post by:
Any ideas how I can have a button click on one open page force a postback on a different page.
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.