asp.net cms Binding Data article _ Practical Tips

Source: Internet
Author: User
Six months ago, in the blog Park wrote several asp.net cms articles, at that time, is my CMS has not been done out. It's all rhetoric. Now I have deleted that few.

Today, writing this article, is to feel a little bit of emotion.

Now my CMS also the core is almost finished.

Let's say this C # version of the CMS is called: ancms

the basic grammar of Ancms

1. Binding Data

Copy Code code as follows:

The entire syntax description:
Start Tag <!--{An: Method name filed=[Field 1, Field 2, Field 3] sort=[field Asc|desc] category=[category ID] id=[number ID] keyword=[] page=[true|false] num=[ Paging Display Quantity]}-->

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

Case ①
<!--{An:alist Filed=[id,title,time] sort=[time desc]}-->
<p> No.: ${0}, Title: ${1}, Time:${2}</p>
<!--{/an}-->
Where alist represents: a list of articles.
I also wrote some other methods: List,plist,llist ...
plist says: A list of products.
Llist: A list of links.
List: Generic lists (articles, products, links ...) are included)

Filed this is the field name of the database. I believe we all understand.
In subsequent releases, I default the field ID to the first, without having to fill in the
namely:<!--{an:alist filed=[title,time] sort=[time desc]}-->
<p> No.: ${0}, Title: ${1}, Time:${2}</p>
<!--{/an}-->
In which time is often formatted.
So I wrote a method.
<!--{An:alist Filed=[title,time] sort=[time desc]}-->
<p> No.: ${0}, Title: ${1}, Time:${2|yyyy-mm-dd}</p>
<!--{/an}--> believe that we all understand the meaning of time format.

Category is classified as its name suggests. Fill in the category ID.
List of articles with category ID equal to 1 <!--{an:alist Filed=[title,time] category=[1]}--> <p> No.: ${0}, Title: ${1}, Time:${2}</p> <!--{/an}-->
Category Id= #表示从Url获取编号ID <!--{an:alist Filed=[title,time] category=[#]}--> <p> No.: ${0}, Title: ${1}, Time: ${2}</p > <!--{/an}-->

ID ibid.

Page Indicates whether pagination is paginated, default is not paging
Num represents the number displayed per page. The default is 10, and if 0 displays all.

Keyword represents a fuzzy query, which is a keyword search.
Well, that's pretty much the case for binding data.

It's a bit cold this evening. The binding data is written here.

Continue tomorrow night. The implementation of each method, I will post in the subsequent article one by one.

I hope you can communicate with each other. Everyone together to create our own asp.net cms.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.