html5 - How to paas img src value dynamically from asp.net -
i want pass src value using asp.net , c# code.
actually want use multiple html tags in want set values asp.net c# code
c# webform code behind:
public string path; public string posterpath; protected void page_load(object sender, eventargs e) { path = "../videos/2.mp4"; posterpath = "../images/user.jpg"; }
html:
<img src="[passed_value]" width="100" height="100" /> <video controls="controls" poster="[passed_value]" width="550" height="320"> <source src="../videos/2.mp4" type="video/mp4"> </video>
i want pass dynamic src
, poster
value using asp.net webforms
please me regarding this...
the simplest solution write variable values using response.write
shorthand syntax <%=variable%>
so:
c# webform code behind:
public string path; public string posterpath; protected void page_load(object sender, eventargs e) { path = "../videos/2.mp4"; posterpath = "../images/user.jpg"; }
html:
<img src="<%=path%>" width="100" height="100" /> <video controls="controls" poster="<%=posterpath%>" width="550" height="320"> <source src="../videos/2.mp4" type="video/mp4"> </video>
note: answer posted posterity dev sharma's solution in question comments above.
Comments
Post a Comment