rurajase
asked on
"Refresh"ing question
Got a button on a asp page. Code looks like :
<a href="<%=strCurrURL%>" onClick="navBarSelect(<%=i ntPage%>,t rue)"><img src="../images/ButConfrm.G IF" border="0" WIDTH="131" HEIGHT="20"></a>
where navBarSelect() is a custom function. Now, when the user clicks on the button I want the CURRENT Page refreshed. Notice that strCurrURL is a string that has the current page URL but it doesn't seem to be updating the changes on the page or rather the one frame on the page does not update.
<a href="<%=strCurrURL%>" onClick="navBarSelect(<%=i
where navBarSelect() is a custom function. Now, when the user clicks on the button I want the CURRENT Page refreshed. Notice that strCurrURL is a string that has the current page URL but it doesn't seem to be updating the changes on the page or rather the one frame on the page does not update.
ASKER
nope..didn't work
Could it be syntax? notice the ; at
the end...
onClick="navBarSelect(<%=i
do you/ have you checked to see if the
strCurrURL and/or intPage
contains the correct/any data?
Is there another SUBMIT button?
Is this within (another) Form?
I have done something like this,
and call a JavaScript function
which does a document.form.submit()
for the href link....
HTH,
Fuzzhead
ASKER
No...it works real fine except I have to go to another page and come back to this one to see the changes. It is definitely doing what it's supposed to do.
you could just automate going to another page and back to this one.
ie:
<a href="<%=redirecturl%>"
redirecturl:
<% response.redirect(strCurrU RL) %>
Rob;-)
ie:
<a href="<%=redirecturl%>"
redirecturl:
<% response.redirect(strCurrU
Rob;-)
boss the prblem is u are using a vbscript within a javascript and teh onclick event gets fired at the client side, could this be a problem?
ciao
dejavu007
ciao
dejavu007
If it's an ASP page, have you
tried Cache control commands
such that the client's browser
always retrieves page from the
server...
Something like these..
<%
Response.Buffer = True
Response.Expires = 0
Response.AddHeader "cache-control", "private"
Response.AddHeader "pragma", "no-cache"
%>
Fuzzhead
tried Cache control commands
such that the client's browser
always retrieves page from the
server...
Something like these..
<%
Response.Buffer = True
Response.Expires = 0
Response.AddHeader "cache-control", "private"
Response.AddHeader "pragma", "no-cache"
%>
Fuzzhead
I don't know your navBarSelect function is for what?
ASKER
It has nothing to do with cache as I have coded it to always retrieve from the server. Besides, this button is on a frame that is common to all pages in the application. It works from the second time on..i.e the changes are shown real time....
Why not try the following:
1) add an onclick event to the image to run your navBarSelect function.
2) remove the anchor tag.
3) add code the bottom of your function as follows:
window.location=<%=strCurr URL%>; (or set the .location for the specific frame, such as top.frames[0].location=<%= strCurrURL %>;).
If this doesn't work, please post more of your code. It is hard to tell where it might be going wrong without seeing the whole picture.
-- Rob --
1) add an onclick event to the image to run your navBarSelect function.
2) remove the anchor tag.
3) add code the bottom of your function as follows:
window.location=<%=strCurr
If this doesn't work, please post more of your code. It is hard to tell where it might be going wrong without seeing the whole picture.
-- Rob --
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
vgrasparil : so if you are guessing then post a comment.
Rob;-)
Rob;-)
ASKER
Okay, here's my NavBarSelect function:
function navBarSelect(aicpage,updat e)
{
parent.aicheader.location. href='AICH eader.asp? page=' + aicpage;
parent.aicnavbar.location. href='AICN avBar.asp? page=' + aicpage;
parent.aicfooter.location. href='AICF ooter.asp? page=' + aicpage + "&update=" + update;
}
It's only a function that decides what navigation frame and header and footer to use
function navBarSelect(aicpage,updat
{
parent.aicheader.location.
parent.aicnavbar.location.
parent.aicfooter.location.
}
It's only a function that decides what navigation frame and header and footer to use
Have you tried what I suggested above?
history.go(0)
as your last line in your navbar function.
Rob;-)