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.
在html页面上我有
<a href="" id="href1" runat="server" rel="{gallery: 'gal1', smallimage: 'demos/imgProd/thumb-img2.jpg',largeimage: 'demos/imgProd/more-info-img1.jpg'}"></a>
我必须在服务器端(.cs)写href的rel内容
喜欢
href1.rel="";
但它向我显示了一个错误我应该如何写?
您需要添加一个属性
href1.Attributes.Add("rel", "");