• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

How to make ASP redirect to an HTML page

I have an ASP page that Inserts data into an MS Access database. After the data has been successfully entered it uses the following ASP code to give a successfull response.

Response.Write "Congratulations E Hoa Ma you have successfully registered with Nga Hapu O Nga Ruahine Iwi. click on the back button to return to the website !"

How do i make the ASP page redirect to an HTML page after successfully entering the data.
0
nikora1
Asked:
nikora1
1 Solution
 
HuyBDCommented:
You can you response.redirect("...") , in your case, try that

Response.Write "Congratulations E Hoa Ma you have successfully registered with Nga Hapu O Nga Ruahine Iwi. click on the back button to return to the website !"
Response.Write "<input type=""button"" value=""return"" onclick=""windows.location.href=""yourpage"""">"
0
 
GawaiCommented:
either
response.redirect("home.asp")

or


Response.Write "Congratulations E Hoa Ma you have successfully registered with Nga Hapu O Nga Ruahine Iwi. click on the back button to return to the website !"
Response.Write "<input type=""button"" value=""return"" onclick=""window.location='home.asp'"">"

this will work fine
0
 
srini5474Commented:
this eg would solve this question as well as your form validation question,

in this example i have written a code to vaildate the form and submit it if required fields are filled in. Once the required fileds as sucessfully filled in the form submits and directs you to DBinsert.asp page in which you can write code to insert into DB and gives a congartulation message followed by a button which will direct you to your home page.

<%@ language="javascript" %>
<html>
<head>
    <title>Untitled Page</title>
</head>
<script language="javascript">
function doSubmit(form)
{  
    if (IsEmpty(form.Topic.value)) {
        alert("Session Topic is a required field.");
        return(false);
      }
     return true;
}
function IsEmpty(str)
{
      return (str.length == 0);
}
</script>
<BODY>
<FORM ID="NewSchedule" NAME="NewSchedule" METHOD="POST" action="DBinsert.asp"
                  onsubmit="return doSubmit(this);">
<input type="text" name="Topic" />
<input type="submit" value="submit" />
</FORM>
</BODY>
</html>

// code for DBinsert.asp page

<%@ language="javascript" %>
<%
    // code your DB operations
    Response.Write("Congratulations E Hoa Ma you have successfully registered with Nga Hapu O Nga Ruahine Iwi. click on the back button to return to the website !");
    Response.Write ("<input type='button' value='return' onclick=window.location.href='home.htm'>");
   
%>

Hope this helps :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now