如何动态更改首页 [英] how change the first page dynamically

查看:84
本文介绍了如何动态更改首页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改第一页的显示,我想在用户需要时动态显示另一页.

How can I change show of the first page , I want to another page to show first dynamically when the user want

推荐答案

您确实没有给出还有很多细节可以尝试,但是可以尝试这样的方法.

You really haven''t given much detail to go on but try something like this.

protected void PageLoad()
{
    if(Session["first"])
       Session.Transfer("...");
}


,您会看到

如果您的意思是允许用户决定他们登录时看到的页面,则可以存储他们在数据库中的首选项,并在他们登录时将其读回并从登录页面或默认主页重定向到其首选页面,如下所示:
If all you mean is to allow your users to decide what page they see when they login, you can store their preference in a database, and when they login, read it back and redirect them to their preferred page from the login page or the default home page like this:
string landingPage = Session["LandingPage"].ToString();
Response.Redirect(landingPage);


这篇关于如何动态更改首页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆