Blog Content

    티스토리 뷰

    28.C# ASP.NET - Html 대체 컨트롤 [WebStandardControl]

    반응형
    어떤 모양에 대해서 구현한다면 HTML 태그를 추천합니다.

    - 링크를 동적으로 만들 땐 서버컨트롤을 이용
    - 태그가 속도가 빨라 포털사이트와 같은 사이트는 메인페이지를 태그로 사용,
       하지만 관리자사이트는 서버컨트롤을 사용

    FrmHtml.aspx

    <div>

       하이퍼링크 :

       <a href="http://www.dotnetkorea.com/" title="닷코로이동"

           target="_blank">닷넷코리아</a>

      

       <asp:HyperLink ID="lnkDotNetKorea" runat="server"

           NavigateUrl="http://godffs.tistory.com/"

           Target="_blank"

           ToolTip="준철이블로그">

           준철이블로그

       </asp:HyperLink><br />

       <br />

      

       이미지:

       <img src="./images/btn_home.gif" alt="홈으로..." title="홈으로..." />

       <asp:Image ID="imgHome" runat="server"

           ImageUrl="./images/btn_home.gif" ToolTip="홈으로..."

           AlternateText="홈으로..." /><br />

       <br />

      

       이미지맵:

       <img src="./images/btn_home.gif" border="0" usemap="#GoHome" />

       <map name="GoHome">

           <area shape="circle" coords="16, 16, 5"

               href="http://www.dotnetkorea.com/"

               alt="닷넷코리아" target="_blank" />

           <area shape="rect" coords="0,0,5,5"

               href="http://Godffs.tistory.com/" alt="준철이블로그" />

       </map>

      

       <asp:ImageMap ID="mapHome" runat="server"

           ImageUrl="./images/btn_home.gif">

           <asp:RectangleHotSpot AlternateText="준철이블로그"

               Bottom="5" HotSpotMode="Navigate"

               NavigateUrl="http://godffs.tistory.com" Right="5" Target="_blank" />

              

           <asp:CircleHotSpot AlternateText="닷넷코리아"

               HotSpotMode="Navigate"

               NavigateUrl="http://www.dotnetkorea.com/"

               Radius="5" Target="_blank" X="16" Y="16" />

       </asp:ImageMap><br />  

       <br />

     

       테이블:<br />

       <table border="1">

           <tr>

               <td>

                   11열테이블

               </td>

           </tr>

       </table>

       <asp:Table ID="tblTable" runat="server" GridLines="Both">

           <asp:TableRow ID="TableRow1" runat="server">

               <asp:TableCell ID="TableCell1" runat="server"

                   BackColor="Lime">11</asp:TableCell>

              <asp:TableCell ID="TableCell2" runat="server"

                  BackColor="Yellow">12</asp:TableCell>

           </asp:TableRow>

          

           <asp:TableRow ID="TableRow2" runat="server">

               <asp:TableCell ID="TableCell3" runat="server"

                   BackColor="Blue">21</asp:TableCell>

               <asp:TableCell ID="TableCell4" runat="server"

                   BackColor="Red">22</asp:TableCell>

           </asp:TableRow>

       </asp:Table>

     

       목록:

       <ul>

           <li>C#</li>

           <li>ASP.NET</li>

       </ul>

      

       <asp:BulletedList ID="bulFavorite" runat="server"

           BulletStyle="UpperRoman">

           <asp:ListItem>C#</asp:ListItem>

           <asp:ListItem>ASP.NET</asp:ListItem>

       </asp:BulletedList>

    </div>


    FrmHtml.aspx.cs

    protected void Page_Load(object sender, EventArgs e)

    {

        bulFavorite.Items.Add(new ListItem("Silverlight", "Ria"));

    }


    결과화면

    [그림28-1]



    반응형

    Comments