hello dear
i m a new web developer. i need to show image from F drive to website . please anybody help me best regards . my trial in below ......
button_click
{
var st = from s in db.WOs where s.WONo.StartsWith(TextBox1.Text) select s;
MaskedDataList1.DataSource = st;
MaskedDataList1.DataBind();
var st1 = (from s in db.WOs where s.WONo==TextBox1.Text select s).First();
string ff = st1.filesWO;
Response.ContentType = "image/jpeg"; // for JPEG file
string physicalFileName = @"F:\WO\"+ff;//prWO1-1.jpg";
Image img = new Image();
img.ImageUrl = physicalFileName;
//Response.WriteFile(physicalFileName);
}
.........Design.........
<asp:DataList ID="MaskedDataList1" RepeatColumns="2" runat="server"
onitemcommand="MaskedDataList1_ItemCommand"
Width="977px" BackColor="#FFFF66">
<ItemTemplate><br />
<table border="0" cellpadding="0" cellspacing="0" height="110" width="110" align="center"
bgcolor="#F0F8E6">
<tr>
<td width="10" bgcolor="#F0F8E6">
</td>
<td valign="middle" bgcolor="white" height="150" width="150" align="center">
<%# Eval("WONo")%> <%--title='WO/<%# Eval("filesWO") %>'--%>
<a href="javascript:void(0);">
<img src='@F:/WO/<%# Eval("filesWO") %>' align="top" title='@F:/WO/<%# Eval("filesWO") %>' style="border: solid 1px Gray;" height="410" width="400" /> <asp:Button ID="Button1" runat="server" Text='<%#Eval("WONo")%>' />
</a></td>
<br /><td width="10" bgcolor="#F0F8E6">
<br />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>