Solved

I want to use a button to reload an ASP Page

Posted on 2012-03-23
3
251 Views
Last Modified: 2012-03-23
I have a site that I inherited. Is uses ASP and AJAX.
The page has a field that when changed will impact a calculated value.
There are functions to recalculate each time the page loads.

I could just ask the user to refresh but they get the dialog box "retry etc...."
So I would like to use Onclick to retrieve the same page.
The page needs an argument to return the correct record.

I can't get the correct syntax and could use some help!

The page is accessed in 2 ways so the following gets the record ID:
RecordID = TRIM(request.querystring("id"))   <!-- First try to read the URL -->
IF LEN(RecordID)<1 THEN
  RecordID = TRIM(request.Form("issue"))   <!-- Next try reading from the POST -->
END IF

The button code follows but does nothing
&nbsp;&nbsp;<button type="button" name="Reload" onclick="window.location.href='http://servicetools.corp.com/aim/viewSingleIssue?id='<%=RecordID%>'">Update Calculated Values</button>
0
Comment
Question by:Mswetsky
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 37757278
Try this:

<button type="button" name="Reload"  Value="Update Calculated Values" onclick="location='http://servicetools.corp.com/aim/viewSingleIssue?id=<%=RecordID%>'">

Open in new window

0
 
LVL 1

Author Closing Comment

by:Mswetsky
ID: 37757367
Thanks for the prompt, excellent, and easy to understand solution
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37757409
Thank you!

And I think that by now you figured out that initial button has to be replaced with input attribute:

<input type="button" name="Reload"  Value="Update Calculated Values" onclick="location='http://servicetools.corp.com/aim/viewSingleIssue?id=<%=RecordID%>'">

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now