laredo512 Posted April 29, 2004 Posted April 29, 2004 I have a small project where my website is supposed to accept specific values from another site to authenticate the users. I have no problems with authenticating, I just need to know how to get the variables passed down to me, and send back a confirmation to the originator. The code behind my website is VB.NET Example: Server 1 sends the user to my site with a link http://www.website.com/enter.aspx?id1=value1&id2=value2 I want my server to get the values for id1 and id2, do what it has to do, then send back to server 1 the following http://www.server1.com/received.aspx?id1=newValue&id2=newValue Im not sure how to use the httpRequest or request("fieldName") to acheive this. Any pointers or examples? Thanks Quote Laredo512 * using VS.NET Pro 2003 *
bungpeng Posted April 29, 2004 Posted April 29, 2004 Manually form your new URL and use Response.Redirect to send to that server. HttpRequest and Request is just for retrieving data from Querystring Quote
fadi Posted April 29, 2004 Posted April 29, 2004 get the values by using request.querystring("idX") do what ever u want to do then response.redirect("http://www.server1.com/received.aspx?id1=" & newValue & "&id2=" & newValue Quote
bungpeng Posted April 29, 2004 Posted April 29, 2004 User "Server.UrlEncode" to encode your 'newValue' to avoid error occurs Quote
laredo512 Posted April 29, 2004 Author Posted April 29, 2004 Thanks! Now that I know how to get the variables, I have a follow up on the posting back to server 1 side. When this user is authenticated, the goal is to redirect the user within my site (thats not a problem, I use forms authentication for that) and at the same time I want my server to send back the confirmation to server 1 (the originator) that my server processed the request sucessfully via a URL like: http://server1.com/responseok.aspx?id1=variable If I use Response.Redirect, won't that send the user back to server1? Is there another way? Thanks for any input... Quote Laredo512 * using VS.NET Pro 2003 *
bungpeng Posted April 30, 2004 Posted April 30, 2004 To separate your process to 2, you can look at System.Threading.Thead Quote
cerebrate Posted April 30, 2004 Posted April 30, 2004 Server 1 sends the user to my site with a link http://www.website.com/enter.aspx?id1=value1&id2=value2 I want my server to get the values for id1 and id2, do what it has to do, then send back to server 1 the following http://www.server1.com/received.aspx?id1=newValue&id2=newValue how about this? enter.aspx.cs: // if id1 is a string id1 = Request.QueryString["id1"]; // if id2 is an integer id2 = int.Parse(Request.QueryString["id2"]); // do what you want // redirect Server.Redirect ("http://www.server1.com/received.aspx?id1="+id1+"&id2="+id2.ToString()); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.