What is the meaning of <% @ and <asp: Panel?

In the asp.net generated code from visual web developer 2010, I see the following code:

<%@ Control Language="C#" ClassName="Header" %>

    <asp:Panel ID="Panel1" runat="server">
        <img alt="xxx" 
            src="Images/bird.jpg" 
            width="800" height="110"/>
    </asp:Panel>
    <asp:Panel id="menuPanel" runat="server">
        <a href="1.aspx">Home</a> |
        <a href="2.aspx">Titles</a> |
        <a href="3.aspx">Authors</a> |
        <a href="4.aspx">Publishers</a>
    </asp:Panel>
  • What is the point <%@of asp.net?
  • What is the point <asp:Panel?

I see other examples, <asp:Button <asp:Labeletc.

thank

+3
source share
4 answers

ASP.NET server instructions are enclosed in angle brackets <% ... %>; they tell ASP.NET to process their contents before sending the page to the client browser.

@ , , , .aspx .ascx: Page Control .

<asp:Panel> - ASP.NET WebControl. - HTML. , , .

, ASP.NET Panel <div> Button <input> .

+4

1) <%@ , .
2) <asp:Panel - , HTML div. , .

, <asp - ASP.NET.

+1

, asp: SomeName . - , . w3schools:

HTML- - HTML, .

HTML elements in ASP.NET files are treated as text by default. To make these elements programmable, add the runat = "server" attribute to the HTML element. This attribute indicates that the item should be considered as a server control. The id attribute is added to identify the server control. The identifier reference can be used to control the server at runtime.

+1
source

Source: https://habr.com/ru/post/1763868/


All Articles