开发者

How to setup virtual application with sub domain name?

I have a site called: testsite. Under that site, i want to create 1 virtual application called: app1. Then the url for the new application will be: testsite/app1. Under app1 i have one page: default.aspx. testsite/app1/default.aspx. On page load of default, if i redirect to itself: Redirect("default.aspx"); it went for testsite/default.aspx instead of开发者_StackOverflow社区testsite/app1/default.aspx.

I do not want to convert it to virtual directory for some requirements reasons.

Anyone can help me? I want it to redirect to: testsite/app1/default.aspx without modifying the code. Since in the future i might have more than one application.


Do you have a virtual directory or a application? If you have a application you just need to do this:

Response.Redirect(~/default.aspx)

In this way you always go to the root of the application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜