将用户重定向从一个网页到另一个 [英] Redirecting users from one page to the other
问题描述
我有一个网页,其中从数据库中获取的所有数据
I have a page which gets all its data from the database
www.mysite.com/List/Oct/DisplayPost.aspx?id=120
www.mysite.com/List/Oct/DisplayPost.aspx?id=120
现在我想这个网页重定向到
Now I want to redirect this page to
www.mysite.com/List/Oct/DisplayPost.aspx?id=150
www.mysite.com/List/Oct/DisplayPost.aspx?id=150
这是可能的。有哪些不同的方式来做到这一点?任何简单的方法?
Is that possible. What are the different ways to do it? Any easy way out?
[更新]:这是一个主/内容页面的情况。更仅存在一个页称为DisplayPost.aspx(像一个模板页)..的DisplayPost.aspx?编号= x被生成从数据库动态地获取数据。
[Update]: It's a Master/Content page scenario. More there is only one page called DisplayPost.aspx (like a template page)..the DisplayPost.aspx?id=x gets generated dynamically taking data from the database.
推荐答案
您的选项的Response.Redirect或Server.Transfer的(除了使用JavaScript客户端重定向)。
见<一href=\"http://stackoverflow.com/questions/840052/server-transfer-and-system-threading-threadabortexception\">this帖子对Server.Transfer的的讨论。
Your options are Response.Redirect or Server.Transfer (aside from a client redirect using Javascript). See this post for a discussion of Server.Transfer.
这篇关于将用户重定向从一个网页到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!