Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp page redirect question.

Status
Not open for further replies.

jjjax0330

IS-IT--Management
Aug 15, 2005
76
US
We have an asp page which loads initially with some default information then when they click on a one of 3 links, it calls another asp page that basically just verifies some session variables then runs an sql procedure which loads some data and updates some session variables then does a response.redirect to the original page with the new information. This works fine but the first time that they click on one of the links, it does everything fine but opens a new browser window. After that, if they click on the other links to update that page again, it keeps updating that same window which is what we want but don't understand why it doesn't do it in the original window. Thanks, Joe
 
The original page has 3 frames but here is the source for the main page which is the page that we really just want to refresh after running our other asp page to update some information:

<IFRAME NAME="includeframe" width="100%" height="100%" SRC="CustomerNavigationFacilities.asp" frameborder=0></IFRAME>
</TD>
</TR>
</TABLE>
<table border="0" width="100%" height="45%" cellspacing="0">
<TR>
<td width="50%" height="100%" valign="top" rowspan="1">
<IFRAME NAME="includeframe" width="100%"
height="100%" SRC="CustomerNavigationScreens.asp" frameborder=0></IFRAME>
</td>
<td width="50%" height="100%" valign="top" rowspan="1">
<IFRAME NAME="includeframe" width="100%" height="100%" SRC="CustomerNavigationReports.asp" frameborder=0></IFRAME>
</td>


This is the first frame page, CustomerNavigationFacilities.asp, which is the page that they can select the facility which is the page that calls the other asp page which we do our selection and update session vairable. The variable thisvalue is loaded from some sql procedure that returns the facilities so the actual page will have three links, one for each of our facilities but just with a different value that will get passed to the SessionVariablesRefresh.asp.

<td id="DetailLink"><a href="SessionVariablesRefresh.asp?id1=<% response.write rstemp(0)%>" target = "Blank"><%=thisvalue%></a></td>

The following is the part of the SessionVariablesRefresh.asp page that we want to redirect back to the main page now that the infomation has been updated.

Response.Redirect("CustomerNavigationMenu_copy.asp")

I could see it opening a new page every time but it's only doing it the first time then it just keeps refreshing the current page.

Hope you can follow this. Thanks, Joe


 
Code:
<td id="DetailLink"><a href="SessionVariablesRefresh.asp?id1=<% response.write rstemp(0)%>" target = "[b]Blank[/b]"><%=thisvalue%></a></td>

It could be that it's creating a window named "Blank" and then when you click the link again, the window already exists so it loads into the same window.

Try either removing the target="Blank" completely or change it to target="_blank"

If you don't want it to load in a new window, why is the target attribute set to "Blank" anyway?

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
It looks like the Blank was just a typo and that would explain why it would work the after the first time. So, when I changed to _blank, it would keep opening a new window which makes since. I looked at the other options and it looks like _parent is what we want. I tested that and seems to be good. THANKS for the help! Joe
 
No probs.

_parent will open the url in the parent window. In your case, because you have a frameset it will replace the frameset.

_blank will open a new window

_self will open the url in the same window or frame within the existing frameset

You can also specify window or frame names, which was what you were inadvertantly doing.

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top