Solved

"Refresh"ing question

Posted on 2000-03-20
14
251 Views
Last Modified: 2011-08-18
Got a button on a asp page. Code looks like :
<a href="<%=strCurrURL%>" onClick="navBarSelect(<%=intPage%>,true)"><img src="../images/ButConfrm.GIF" 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.
0
Comment
Question by:rurajase
  • 4
  • 3
  • 2
  • +4
14 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 2636568
try placing
history.go(0)
as your last line in your navbar function.
Rob;-)
0
 

Author Comment

by:rurajase
ID: 2636619
nope..didn't work
0
 

Expert Comment

by:Fuzzhead
ID: 2636663

Could it be syntax? notice the ; at
the end...

onClick="navBarSelect(<%=intPage%>,true);"

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

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:rurajase
ID: 2636683
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.
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2636871
you could just automate going to another page and back to this one.

ie:

<a href="<%=redirecturl%>"

redirecturl:
<% response.redirect(strCurrURL) %>

Rob;-)
0
 
LVL 1

Expert Comment

by:dejavu007
ID: 2636874
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
0
 

Expert Comment

by:Fuzzhead
ID: 2636961
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
0
 

Expert Comment

by:doantu01
ID: 2637144
I don't know your navBarSelect function is for what?
0
 

Author Comment

by:rurajase
ID: 2637477
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....
0
 
LVL 3

Expert Comment

by:rmullins
ID: 2638913
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=<%=strCurrURL%>; (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 --
0
 

Accepted Solution

by:
vgrasparil earned 100 total points
ID: 2638985
Try this.
<a href="<%=strCurrURL%>" onClick="return navBarSelect('<%=intPage%>');"><img src="../images/ButConfrm.GIF" border="0" WIDTH="131" HEIGHT="20"></a>
 
Im not quite sure what intPage is but Im
thinking its a string or something. And if that's the case you forgot the apostrophes.

In your function navBarSelect return true if you want the page to goto the href...return false if you dont wannt to refresh.
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2639469
vgrasparil : so if you are guessing then post a comment.
Rob;-)
0
 

Author Comment

by:rurajase
ID: 2640332
Okay, here's my NavBarSelect function:
function navBarSelect(aicpage,update)
{
parent.aicheader.location.href='AICHeader.asp?page=' + aicpage;
parent.aicnavbar.location.href='AICNavBar.asp?page=' + aicpage;
parent.aicfooter.location.href='AICFooter.asp?page=' + aicpage + "&update=" + update;
}

It's only a function that decides what navigation frame and header and footer to use
0
 
LVL 3

Expert Comment

by:rmullins
ID: 2641762
Have you tried what I suggested above?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Age between date range query (SP) 13 69
ASP SQL Syntax Duplicate Key 7 110
How to alternate between 2 messages until page closes in Classic ASP 8 38
innerHTML 7 34
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question