Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想QueryString在非控制器类中获取
QueryString
string configType = Request.QueryString["configType"];
我应该使用什么命名空间?
using System.Web不工作
using System.Web
试试这个:
var valueOfT = System.Web.HttpContext.Current.Request.QueryString["t"];
但要有主动性HttpContext。
HttpContext
但我最好建议将值从您的控制器类传递给非控制器类。
我正在尝试显示一个带有超链接的简单 div,x 如下所示:
x
所以,当我运行我的应用程序时,我看到了 div 但我没有