Image.ImageUrl 속성

정의

Image 컨트롤에서 표시할 이미지에 경로를 제공하는 URL을 가져오거나 설정합니다.

public:
 virtual property System::String ^ ImageUrl { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public virtual string ImageUrl { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.ImageUrl : string with get, set
Public Overridable Property ImageUrl As String

속성 값

String

Image 컨트롤에서 표시할 이미지에 경로를 제공하는 URL입니다.

특성

예제

다음 예제에서는 사용 하는 방법에 설명 합니다 ImageUrl 에 표시할 이미지의 위치를 지정 하는 속성을 Image 컨트롤.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Image Example</title>
</head>
 
<body>

   <form id="form1" runat="server">

      <h3>Image Example</h3>

      <asp:Image id="Image1" runat="server"
           AlternateText="Image text"
           ImageAlign="left"
           ImageUrl="images/image1.jpg"/>
  
   </form>

</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Image Example</title>
</head>
 
<body>

   <form id="form1" runat="server">

      <h3>Image Example</h3>

      <asp:Image id="Image1" runat="server"
           AlternateText="Image text"
           ImageAlign="left"
           ImageUrl="images/image1.jpg"/>
  
   </form>

</body>
</html>

설명

사용 하 여는 ImageUrl 속성에 표시할 이미지의 URL을 지정 하는 Image 컨트롤입니다. 상대 또는 절대 URL을 사용할 수 있습니다. 서버에서 전체 경로 지정 하지 않고 웹 페이지의 위치에 이미지의 위치를 연결 하는 상대 URL입니다. 경로 웹 페이지의 위치에 상대적입니다. 이 쉽게 전체 사이트 코드를 업데이트 하지 않고 서버에서 다른 디렉터리로 이동 합니다. 절대 URL 코드를 업데이트 해야 사이트 다른 디렉터리를 이동 하므로 전체 경로 제공 합니다.

적용 대상