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.
我正在尝试从后面的 ASP.net 页面代码访问 javascript 文档。如何在后面的 c# 代码中执行与以下相同的操作?
document.getElementById(id).src = "myurl.com"
谢谢您的帮助。
将 runat="server" 和 ID 添加到元素。然后,您应该能够通过属性集合访问 src。
<img src="http://www.google.com/img.png" id="imgGoogle" runat="server" /> Dim src as String = imgGoogle.Attributes("src")