如何在标签框中获取网址路径 [英] How to get the url path in the label box

查看:105
本文介绍了如何在标签框中获取网址路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取从url到标签框的路径.

我们无法对其进行硬编码,它应该来自URL.

How to fetch the path from the url, to a label box.

We can''t hard code it, it should come from URL.

推荐答案

嗨 利普萨,

Hi Lipsa,

Label1.Text = Request.Url.AbsolutePath.ToString();



如有任何疑问,请告诉我.

请提供"投票":thumbsup:如果有帮助,请提供"接受答案",如果这是正确的答案.:rose:

谢谢,
Imdadhusen



Please do let me know, if you have any doubt.

Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen


您可以使用给定的代码在标签框中获取url路径

You can use given code to get url path in the label box

// Get the absolute URI 
Label1.Text = HttpContext.Current.Request.Url.AbsoluteUri; 
//Get the absoulte path of URI
 Label1.Text = HttpContext.Current.Request.Url.AbsolutePath;


这篇关于如何在标签框中获取网址路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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