Solved

I want to use a button to reload an ASP Page

Posted on 2012-03-23
3
252 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

863 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

27 Experts available now in Live!

Get 1:1 Help Now