Reputation: 3404
I want server.transfer to transfer the control to a different website other than the one I am in currently. Is that possible.
One way I thought of doing is to read the contents of that website and write in the response but would love to know if any other way to do so.
My website is www.xyz.com/otherwebsite/forms/page.aspx So in above url, www.xyz.com is a website and otherwebsite is also a website and I want to do server.transfer from otherwebsite to www.xyz.com
Upvotes: 0
Views: 1661
Reputation: 1
You could use javascript for this. Just inject the javascript using
ScriptManager.RegisterClientScriptBlock methodd
Upvotes: 0
Reputation: 3404
I finally did the Response.Write(Reading content from the specific location) method. Server.Transfer can only be used on the same virtual directory (i.e. on same website) as it transfers all the request information to the next page and it can only be done on same session.
Thanks,
Nimesh
Upvotes: 2
Reputation: 72222
If you just want to Redirect, use Response.Redirect("http://www.mywebpage.com/");
Not entirely sure what you mean by Transfer, but if you update your question I can provide more help.
Upvotes: 1
Reputation: 24909
you have couple choices..
Server.Transfer - does a transfer w/out notifying the browser. so your browser will still see the first website in the address bar.
Response.Redirect- tells the browser to go to another site. The behavior will seem similar to the user. transfer is faster because of less round trips, but most likely not what you want due to the address bar issue..
you could also configure IIS to redirect particular address,
really depends on your requirements...
Upvotes: 1