-4
문제는 내가 lnkFV 링크 버튼을 클릭하면 이미지 URL을 설정합니다. 이미지는 페이지에 표시되지 않습니다.
소스업로드 이미지보기
<tr>
<td style="width: 160px; height: 15px">
<asp:Label ID="Label4" runat="server" Text="Style Front View">
</asp:Label>
</td>
<td style="width: 222px; height: 15px">
<asp:FileUpload id="filFrontView" runat="server">
</asp:FileUpload>
</td>
<td style="width: 72px; height: 15px">
<asp:LinkButton id="lnkFV" runat="server" OnClick="lnkFV_Click">
View image</asp:LinkButton>
</td>
<td colspan="3" rowspan="1">
<asp:Image id="Image1" runat="server">
</asp:Image></td>
</tr>
ASP 코드
protected void lnkFV_Click(object sender, EventArgs e)
{
// new Help().Perform("Do you really want to proceed");
try
{
file = Path.GetFileName(filFrontView.PostedFile.FileName);
// file = Path.GetFileName(filFrontView.PostedFile.FileName);
tempF = "F:\\Visual Studio 2005\\User\\temp\\" + file;
temp = "~\\temp\\" + file;
filFrontView.SaveAs(Server.MapPath(temp));
// filFrontView.SaveAs(temp);
string filePath = MapPath(temp);
Image1.ImageUrl = tempF;
}
catch (Exception ee)
{
}
}
무엇이 오류입니까? –
이미지가 보이지 않습니다. – Suchinthaka
ASP.NET Ajax를 사용하고 있습니까? 파일이 제대로 저장되고 있습니까? 예외가 있습니까? 더 자세한 정보가 필요합니다. –