Principles of cms in asp.net

Source: Internet
Author: User

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.

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.