我有这个网址:http://localhost:49500/Learning/Chapitre.aspx?id=2
如何获取此网址中 id
的值?
最佳答案
您可以通过Request.QueryString()
数组访问所有查询字符串:
Request.QueryString("id")
将为您提供 2
关于asp.net - 从任意 URL 获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3058030/