asp.net's cms binding data piece

  • 2020-05-19 04:37:16
  • OfStack

Half a year ago, I wrote several articles on asp.net cms in bloggarden. At that time, my cms had not been made yet. It's all talk. I've deleted those now.

Today, write this, is to want to sigh with emotion 1.

Now my CMS core is almost complete.

Let's call this cms version of c# : anCms

Basic syntax of anCms:

1. Bind data


 Grammar description:  
 Start tag <!--{an: The method name  filed=[ field 1 , the field 2 , the field 3] sort=[ field  asc|desc] category=[ classification ID] id=[ Serial number ID] keyword=[] page=[true|false] num=[ Paging display quantity ]}--> 

<!--{/an}--> The end tag  

 Case 1.  
<!--{an:alist filed=[id,title,time] sort=[time desc]}--> 
<p> No. : ${0}, The title :${1}, time :${2}</p> 
<!--{/an}--> 
 Among them alist  A list of articles.  
 I also wrote 1 Some other ways: list,plist,llist... 
plist  A list of products.  
llist  A list of links.  
list  Common list ( Articles, products, links ... includes ) 

filed  All of these are database field names. I'm sure you all understand.  
 In a later version, I'll take the field id The default to the first 1 , there is no need to fill in  
 That is: <!--{an:alist filed=[title,time] sort=[time desc]}--> 
<p> No. : ${0}, The title :${1}, time :${2}</p> 
<!--{/an}--> 
 Time is often formatted.  
 So I wrote it 1 A method.  
<!--{an:alist filed=[title,time] sort=[time desc]}--> 
<p> No. : ${0}, The title :${1}, time :${2|yyyy-MM-dd}</p> 
<!--{/an}-->  I think you all understand what time formatting means.  

category  Classification, as the name implies. Fill in the classification ID Can.  
 classification ID Is equal to the 1 List of articles <!--{an:alist filed=[title,time] category=[1]}--> <p> No. : ${0}, The title :${1}, time :${2}</p> <!--{/an}--> 
 classification ID=# Says from the Url Access number ID <!--{an:alist filed=[title,time] category=[#]}--> <p> No. : ${0}, The title :${1}, time :${2}</p> <!--{/an}--> 

id  Same as above.  

page  Indicates whether the page is paged, and it is not paged by default  
num  Represents the number displayed per page. The default is 10 If, for 0 Displays all.  

keyword  Represents a fuzzy query, or keyword search.  
 Ok, so that's pretty much the end of the data binding example. 

It's a bit cold tonight. I'm going to write the binding data here.

We'll continue tomorrow night. The implementation of each method will be posted in a subsequent article 11.

I hope you can communicate with each other. Let's make cms which belongs to us: asp.net.

Related articles: