重定向 [英] Redirection

查看:66
本文介绍了重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




i有我的应用程序,其中我从我的代码后面重定向到其他页面,例如:

Response.Redirect(" \ MyVirtualDirName\Admin.aspx")。


但是,如果我要更改我的虚拟目录的名称

,那么这有点严格限制,那么应用程序就会中断。


所以如果有其他方法可以做到这一点..可以通过we.config来完成。


谢谢

Hi,

i have my app wherein i am redirecting to other pages from my code behind for eg:
Response.Redirect("\MyVirtualDirName\Admin.aspx").

However this is a bit tightly bound in the sense that if i were to change the name
of my virtual directory then the applicatio n would break.

So if there any other way to do this.. can it be done through the we.config.

Thanks

推荐答案





i有我的应用程序,其中我从我的重定向到其他页面代码背后例如:

Response.Redirect(" \ MyVirtualDirName \Admin.aspx")。


但是,如果我要更改我的虚拟目录的名称

,那么这有点严格限制,那么应用程序就会中断。


所以如果有其他方法可以做到这一点..可以通过we.config来完成。


谢谢
Hi,

i have my app wherein i am redirecting to other pages from my code behind for eg:
Response.Redirect("\MyVirtualDirName\Admin.aspx").

However this is a bit tightly bound in the sense that if i were to change the name
of my virtual directory then the applicatio n would break.

So if there any other way to do this.. can it be done through the we.config.

Thanks



它应该可以工作。


Response.Redirect("〜/ admin.aspx");


快乐编程:)


It should work.

Response.Redirect("~/admin.aspx");

Happy programming :)




Ya非常感谢..但是我也有像使用虚拟目录名设置路径的图像。但是,如果我使用〜它不适合。给予像:

images / ad.gif而不是/VirDirName/images/ad.gif适用于那些不在任何文件夹内的文件。


如果某些文件在文件夹中,而我要提供images / ad.gif则图像显示不正确。


Thankx 。
Hi,
Ya thanks a lot.. however like i also have images whose path are being set using the virtual directory name. But if i use the ~ its not coming proper. Giving like:
images/ad.gif instead of /VirDirName/images/ad.gif works well for those files which are not inside any folders.

If some files are inside a folder and i were to give images/ad.gif then the images are not displayed properly.

Thankx.





雅非常感谢..但是我喜欢我也有路径正在拍摄的图像使用虚拟目录名称设置。但是,如果我使用〜它不适合。给予像:

images / ad.gif而不是/VirDirName/images/ad.gif适用于那些不在任何文件夹内的文件。


如果某些文件在文件夹中,而我要提供images / ad.gif则图像显示不正确。


Thankx 。
Hi,
Ya thanks a lot.. however like i also have images whose path are being set using the virtual directory name. But if i use the ~ its not coming proper. Giving like:
images/ad.gif instead of /VirDirName/images/ad.gif works well for those files which are not inside any folders.

If some files are inside a folder and i were to give images/ad.gif then the images are not displayed properly.

Thankx.



< img src ="〜/ images / ad.gif" />


它会起作用。


享受:)


<img src="~/images/ad.gif" />

It will work.

enjoy :)


这篇关于重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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