CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2002
    Posts
    21

    response.redirect question ?

    How do I change this to a response.redirect please?

    <A HREF="default.asp?fname=<%=filename%>">Continue</A>

    Thanks in advance.

  2. #2
    Join Date
    Jan 2002
    Location
    Helsinki, Finland
    Posts
    99

    Re: response.redirect question ?

    Originally posted by Klas
    How do I change this to a response.redirect please?

    <A HREF="default.asp?fname=<%=filename%>">Continue</A>

    Thanks in advance.
    This is HTML :
    <A HREF="default.asp?fname=<%=filename%>">Continue</A>

    This is server-side scripting :
    <%
    Response.Redirect("http://www.google.com")
    %>


    Notice the diffence?

    In addition, please explain what you're trying to do and post either URL or source, if possible.
    Zvona - First aid for client-side web design

  3. #3
    Join Date
    Oct 2002
    Posts
    21
    Hi!

    Sure I will.

    I have
    <A HREF="default.asp?fname=<%=filename%>">Continue</A>

    at the end of a page where I have used JMAIL for uplaoding a file chosed by the user. The variable of the file is "filename".

    And instead of clicking on Continue, I would like that the page default opends automaticly, and brings the filename in the url(as a querystring)

    It works fine with the HTML link now, but it is a unnessecery(spelling?) step.

    (ASP)

    Best regards, Klas

  4. #4
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104
    For server side scripting (ASP), do this at the end of your script:
    Code:
    <%
    Response.Redirect("default.asp?fname=" & filename)
    %>
    Although, be aware that the user will never see the page before the redirect occurs. So if you had some message for them there, they won't see it.

    If you do want them to see such a message, you're better off doing a meta:
    Code:
    <META HTTP-EQUIV="Refresh" Content="10; URL =default.asp?fname=<%= filename %>">
    or client-side (javascript) script:
    Code:
    document.location = "default.asp?fname=<%= filename %>"
    redirect.
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured