|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBScript - Discussion - Response.redirect
Hi,
I am implementing the following condition <% If cnt>100 then Response.write "too many records!!. Go back & try again." Response.redirect "back.asp" else .....some coding...... %> <form action="next.asp" method=post> <input type=submit value=submit> <% End if %> However the browser is redirecting itself to the previous page,without showing the message. Alternatively,I have also tried to put a form statement & submit button in IF for going back,but it is submitting next.asp in both conditions. Pls help. How can I do this Thanks |
|
#2
|
||||
|
||||
|
Hi,
You have a couple of options, you could either offer the user a link that they can click instead of just redirecting them to back.asp: Code:
<% If cnt>100 then
Response.write("Too many records <a href=""back.asp"">Click Here to Try Again</a>")
else
.....some coding...... %>
<form action="next.asp" method=post>
<input type=submit value=submit>
<% End if %>
Or you could use javascript to display the message as an alert: Code:
<% If cnt>100 then
Response.write("<script>alert('too many records!!. Go back & try again.');</script>")
Response.redirect "back.asp"
else
.....some coding...... %>
<form action="next.asp" method=post>
<input type=submit value=submit>
<% End if %>
|
|
#3
|
|||
|
|||
|
Quote:
Thanks. I want to display a button for back & when the user click that he should be directed to the previous page. Cannot figure out the coding for that |
|
#4
|
||||
|
||||
|
Quote:
You just need to adapt my first example to use a button instead of a link: Code:
Response.Write("<form name=""dummyForm"" action=""back.asp"" method=""post"">")
Response.write("Too many records <input type=""submit"" name=""btnSubmit"" value=""Try Again""")
Response.Write("</form>")
|
|
#5
|
|||
|
|||
|
Quote:
Many Thanks. Easy solution. |
|
#6
|
||||
|
||||
|
Quote:
You're welcome, glad it helped!! Without meaning to sound rude, the more information you provide in your original question, the more chance we have of providing a solution. |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > VBScript - Discussion - Response.redirect |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|