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.
「InnerHtml」を使用して画像を動的に追加しようとすると、SQLデータベースに画像パスストアがあります。このようなHTMLコードは機能しません。
<div runat=server class="ws_images" id="List_Slide"> </div>
このようなC#コード
List_Slide.InnerHtml = "<li><img src=data1/images/31.jpg alt=31 title=31 id=wows1_0/> </li>"
コードビハインドでwithを追加しrunat="Server"、「src」プロパティを設定できます。
runat="Server"
HTML:
<img runat="server" id="img31" />
CS:
((HtmlImage)img31).Src = "data1/images/31.jpg";