Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I link to another page? 2

Status
Not open for further replies.

danielh68

Technical User
Jul 31, 2001
431
US
I'm currently using an asp form that has worked for me in the past. However, I'd like to tweak it so the submit button takes the user to a new page (instead of just using the response.write "Your message was not sent."). Does anyone now how to do this?


Much appreciated,
Dan
 
use
Response.Redirect "filename.asp" [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Hi onpnt,

It's wierd, I can redirect using an htm, but if fails with a .pdf .

For instance, if you go to and hit submit, there's an error.

However, if you go paste in the identical path it works.

I suppose I can create a htm page that supplies the link, but it adds some redundancy.


Another thing, I thought this code would work as far as compelling the user to input an email address:

<%
else
mailTo= Request.Form(&quot;mailTo&quot;) & &quot;danielh@optistreams.com&quot;
Email= Request.Form(&quot;email&quot;)

Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = &quot;Tech Support&quot;
Mailer.FromAddress = &quot;support@verio-hosting.net&quot;
Mailer.Subject = &quot;IDS-3940799 - &quot; & Subject
Mailer.BodyText = &quot;Email: &quot; & Email & vbcrlf
Mailer.RemoteHost = &quot;mail-fwd.verio-web.com&quot;
Mailer.AddRecipient &quot;Dan&quot;, &quot;danielh@optistreams.com&quot;

if Mailer.SendMail then Response.Redirect &quot; else
' Message failed
response.write &quot;Please provide email address. Thank you.<br>&quot;
response.write &quot;The error was: &quot; & Mailer.Response & &quot;<br>&quot;
end if

end if
%>

I'm definitely doing something wrong, I can hit submit and (if it's an html path) it will bypass my &quot;if&quot; statement and go directly to the page. What am I missing.

Thanks again.

Dan
 
opening pdf's is a little more combersome then jsut redirecting. I have some scripts at work and I'll psot them tomorrow if no one else answers how to do this by then.
[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Yes, an ASP redirect is not like a JavaScript redirect or an HTML link because it is happening on the server. However you can easily fix the problem by just inserting the following on top of your page:

<%
Response.ContentType=&quot;application/pdf&quot;
%>
 
Hi aplusc,

Thanks for the object type, still I had no luck. The test page by the way is . Perhaps, I might install a javascript redirect...although that will add an extra step. Or, even just a regular html page with the pdf link. If you have any other input, please let me know.

Much appreciated,
DanH
 
Hey dan, I just tried the link you gave and it worked fine for me. redirected to the pdf after entering my email. Thought I'd let you know

[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thanks onpnt. you're right. It's something strange happening locally on my system. I've checked it on another and it works fine. Great. Thanks, for the keen observation.

DanH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top