任何用户登录后如何更改网址? [英] How to change web url after any user logged in?

查看:51
本文介绍了任何用户登录后如何更改网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有一个名为
的网址 http://localhost:4444/sample.aspx

它首先显示登录页面.

在任何用户说"abcd"登录后,URL必须更改为

abcd.sample.com.有人可以帮我吗?

For example, I have a web url named
http://localhost:4444/sample.aspx

It first shows the log in page.

After any user say "abcd" has logged in, the url must change to

abcd.sample.com. Can any one help me please?

推荐答案

Login_click()
{
  Responese.Redirect("newPage.aspx");
}


Login_click()
{
//... validate the user and get the user name
Response.Redirect(username +".sample.com");
}



我还没有测试过,但我想您已经尝试过了



Ive not tested this but I guess you''ve already tried


这对我来说很有效
this worked for me though
string name = "plus";
            string url = "http://www."+name+".google.com";
            Response.Redirect(url);



如果要在本地主机中重定向,请使用



If you want to redirect in localhost then use

Server.MapPath(url)


这篇关于任何用户登录后如何更改网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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