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.
如何从服务器端的 c# 获取 asp.net 在客户端呈现的表单的名称或 ID。
还是总是“aspnetForm”?
可以通过该Page.Form属性访问该表单。因此,要获取表单客户端 ID,只需使用:
Page.Form
var formId = Page.Form.ClientID;
获取名称属性使用:
var formName = Page.Form.Name;