小编Mr.*_*son的帖子

在 HTML / cshtml 中获取 URL

我想将当前 URL 转换为一个字符串,我可以稍后将其用于例如共享功能。

String strPathAndQuery = HttpContext.Current.Request.Url.PathAndQuery;
Run Code Online (Sandbox Code Playgroud)

我收到错误:

该名称HttpContext在当前上下文中不存在。

还有其他方法吗?

html url razor

5
推荐指数
2
解决办法
7420
查看次数

标签 统计

html ×1

razor ×1

url ×1