Using the HttpWebRequest object to call a URL does not affect the
browser, it does the call in code and streams the results back into
the calling code.  It is very handy for screen scraping or calling web
services from your code.

If you want to redirect from the browser, you need to use
Reponse.Redirect(URL).  You can pass parameters as part of the URL,
like so...
http://www.somesite.com/apage.cfm?Param1=AValue&Param2=AnotherValue

If you want to post the parameters to the other page and redirect, it
is a bit trickier in ASP.NET.  The way I have found to do it is a
javascript hack.  You basically:

1) write out a dummy form in your page response that has the desired
page as the post action
2) add the desired values in hidden input controls
3) then call the form submit method in javascript.

Here's an example...
  Private Sub JavaScriptPostHack(URL as String, Value1 as String)

        Response.Write("<html><body>")
        Response.Write("<form name='PostForm' action='" & URL & "'
method='POST' >")

        AddHiddenControl("Param1", Value1)

        Response.Write("&</form>")

        Response.Write("<script>")
        Response.Write("document.PostForm.submit();")
        Response.Write("</script>")
        Response.Write("</body></html>")
    End Sub

    Private Sub AddHiddenControl(ByVal Name As String, ByVal Value As String)
        Response.Write("<input type='hidden' name='" & Name & "'
value='" & Value & "' >")
    End Sub

When your page renders it will call the form submit and post to your
desired URL with the supplied values.

HTH

-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to