Last night I wrote a little bit about the Customized cms system tag. Today I wrote the code replaced by the tag.
My method is simple, that is, "replace.
Example ① HTML -- bind data
Copy codeThe Code is as follows:
<! -- {An: alist filed = [title, time] category = [#] num = [10] page = [true] sort = [time desc]} -->
<Li> <span class = "fr_time" >$ {2} </span> <a href = "$ href [articleview] [{" id ", #0}] ">$ {1} </a> </li>
<! -- {/An} -->
Note: $ Href [articleview] [{"id", #0}] represents the address: your domain name/article/view/{id}. I will explain it in subsequent articles.Release: $ Href [articleview] What is this. Example ① ASP. NET source code after replacement
Copy codeThe Code is as follows:
<Script runat = "server">
Protected override void OnLoad (EventArgs e)
{
MyHashtable. Add ("DFE3B56EB5D720382BB90CF468D83C35", Article ("TextFile. ID, title, time", 1, 8, "time desc ","","",""));
}
</Script>
<%
If (1 = 1)
{
Var myRows = MyRows ("DFE3B56EB5D720382BB90CF468D83C35 ");
If (myRows! = Null)
{
Foreach (var a in myRows)
{%>
<Li>
<Span class = "fr_time"> <% = TimeFormart (a [2], "yyyy-MM-dd") %> </span>
<A href = "<% = UrlRoute (" articleview ", new string [,] {" id ", a [0]. toString () }}) %> "> <% = a [1] %> </a>
</Li>
<%}
}
Else
{%>
<P style = 'margin: 10px; '> no information </p>
<%
}
} %>
Here I will explain it a bit.:
MyHashtable. Add (). This is equivalent to filling the list to be obtained above into the DataSet. Example ② HTML -- pagination
Paging:
Paging tag
Copy codeThe Code is as follows:
<! -- {An: alistpager category = [#]} -->
$ Pager [articlelist] [{"category", "# category"}] [10]
<! -- {/An} -->
Example ② HTML -- ASP. NET source code after replacement by PAGE
Copy codeThe Code is as follows:
<Script runat = "server">
Protected override void OnLoad (EventArgs e)
{
MyHashtable. Add ("d9595d2fbd4c65f5d1b28baa8fd96", ArticlePager ("","#",""));
}
</Script>
<%
If (1 = 1)
{
Var myRows = MyRows ("rjd9595d2fbd4c65f5d1b28baa8fd96 ");
If (myRows! = Null)
{
Foreach (var a in myRows)
{%>
<% = Paging ("articlelist", new string [,] {"category", "# category" }}, 10, a [0]) %>
<%
}
}
Else
{%> <P style = 'margin: 10px; '> no information </p> <%
}
} %>
It is all-encompassing, and basically all data bound can be used.
Currently, my cms has more than enough enterprise websites to deal with, and the membership function has yet to be developed.
It has always been developed by a person alone, so you need to take care of the improper use of technology. Because personal technology is too superficial, you are hesitant to open source.
I am afraid of the jokes of the elders.