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开发者_JAVA技巧.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
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
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...
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.
You could use javascript for this. Just inject the javascript using
ScriptManager.RegisterClientScriptBlock methodd
精彩评论