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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting URL of the page and passing it to other page 5

Status
Not open for further replies.

zxcdf5je

Programmer
Joined
Apr 1, 2005
Messages
86
Location
US
hi there,
I have this page which lists all the users name and they can be edited deleted and updated.The page which does that is 2.asp and the page which actually lists all the users is 1.asp.
when i delete a particular user by using 2.asp ,after delteing the users name it redirects me to the first page of 1.asp and i again have to go do 28th page to proceed ahead with other users..is there any way i could catch that page number /page and make the user return to the page from where they came from?

Hope u are understanding what i want..
help needed..pleaseeeee

-Smita

1.asp uses this code to catch url:
'-------------------------------
' list Navigation begin
'-------------------------------
bEof = rs.eof
if not(rs.EOF and iPage=1) then
if iPage = 1 then
%>
<font style="font-size: 10pt; color: #000000; font-weight: bold; font-family: Arial, Tahoma, Verdana, Helvetica">Previous</font>
<%
else
%>
<a href="<%=file_name%>?<%=form_params%><%=sSortParams%>Formlist_Page=<%=iPage - 1%>#list"><font style="font-size: 10pt; color: #000000; font-weight: bold; font-family: Arial, Tahoma, Verdana, Helvetica">Previous</font></a>
<%
end if
response.write "&nbsp;[&nbsp;" & iPage & "&nbsp;]&nbsp;"

if bEof then
%>
<font style="font-size: 10pt; color: #000000; font-weight: bold; font-family: Arial, Tahoma, Verdana, Helvetica">Next</font>
<%
else
%>
<a href="<%=file_name%>?<%=form_params%><%=sSortParams%>Formlist_Page=<%=iPage + 1%>#list"><font style="font-size: 10pt; color: #000000; font-weight: bold; font-family: Arial, Tahoma, Verdana, Helvetica">Next</font></a>
<%
end if
end if
'-------------------------------
' list Navigation end
'-------------------------------

2.asp
has just a variable sActionField="1.asp"
which if delete update pressed would point to this variable and take it to the first page ..

hope that helps
 
The answer to this last problem lies in 1.asp rather than 2.asp.

Hover your mouse pointer over the link and the URL should be displayed in the bottom of the browser window and you can see what I mean.

Make sure the page # is being put into your links on page 1.
 
steven is correct about adding the #list ... it needs to be its own string not just tacked on to the end like that.
 
now its showing this url on update/delete

and this error on this line on 1.asp marked with ***

iPage = GetParam("Formlist_Page")
***if IsEmpty(iPage) then iPage = 1 else iPage = CLng(iPage)
while not rs.eof and iCounter < (iPage-1)*iRecordsPerPage
rs.movenext
iCounter = iCounter + 1
wend
iCounter = 0
 
on page 2 where the update/delete butons are look at the url is there a value after the 'Formlist_Page=' part, there should be something like

Formlist_Page=2

if a number is not show thats the problem - where the <a href.> is on page which takes you to page 2 you are not passing the value

can you past code and the url (for page 1) for the <a href=> part
 
1.asp href=
<a href="<%=fldindexid_URLLink%>?ID=<%=fldindexid_ID%>&<%=transit_params%>Formlist_Page=<%=iPage%>#list">
and the link wud look like this:
2.asp href is

sActionFileName = " & request("s_company") & "&Formlist_Page=" & request("Formlist_Page")&"#list"

this link is looking like this:
 
1.asp should never have an empty value in the iPage variable or else your anchor tag will contain the wrong URL.

If it doesnt have a valid number then the part that I hightlight in red below will be a problem:
<a href="<%=fldindexid_URLLink%>?ID=<%=fldindexid_ID%>&<%=transit_params%>Formlist_Page=[red]<%=iPage%>[/red]#list">

If that is blank then the page number won't be passed to 2.asp when you click the link.
 
can you please make this on a live directory so we can see we what we are doing - feel like i'm driving with my eyes closed
 
"... feel like i'm driving with my eyes closed"

Ditto!
 
hi there!
Hope u had a great weekend..i havent yet touched the code..but will do it later this afternoon and will let u know where i have reached in the url stuff!!

-Smita
 
try separating the # from the rest of the querystring by placing a & between them. Otherwise I believe the final querystring will also contain the # value and not the true page number.
Code:
....Formlist_Page=3[red]&[/red]#list

Tony
_______________________________________________________________
 
do u mean that i do it this way:
<a href="<%=fldindexid_URLLink%>?ID=<%=fldindexid_ID%>&<%=transit_params%>Formlist_Page=<%=iPage%>#&list">

and same in this url in 2.asp too:
sActionFileName = " & request("s_company") & "&Formlist_Page=" & request("Formlist_Page")&"#&list"

Thanks,
Smita
 
What is the purpose of #list?

This is not clear in the code snippets we've seen so far.
 
scheco #list is an anchor to a location on the page - don't think he needs it.

and fester it would actually be

Formlist_Page=" & request("Formlist_Page")&"#list
 
Thats kinda what I was getting at... not enough code to show that it is actually needed for anything... at least not anything opening another can of worms over.
 
Steven,
I suggested &#list to separate the anchor from the querystring. I have a site where this is necessary as otherwise the final querystring value includes the anchor name.

Tony
_______________________________________________________________
 
got you, i thought the "&" in the &#list was a asp & you meant it as a url &
 
Did I mention that I like to put spaces around the ampersands in my VBScript?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top