asp.net cms Principles _ Practical skills

Source: Internet
Author: User

Last night I wrote a little bit about the label of the CMS system I ordered, and today I wrote the code for the label instead.

My method is very simple, is "replace" the word.

example ①html--binding Data

Copy Code code 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}] represented by the address is: your domain/article/view/{id} in the subsequent article I will solve Release: $href [Articleview] What is this thing? Example ① replacement of ASP.net source code
Copy Code code 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 relevant information </p>
<%
}
}%>

I'll explain here a little bit .

Myhashtable.add () This is the equivalent of the list to be fetched, to the dataset DataSet. Example ②html--Paging

page-Effect chart

Paging labels
Copy Code code as follows:

<!--{An:alistpager category=[#]}-->
$pager [articlelist][{"category", "#category"}][10]
<!--{/an}-->

example ②html--asp.net source code after paging replacement
Copy Code code as follows:

<script runat= "Server" >
protected override void OnLoad (EventArgs e)
{
Myhashtable.add ("386d9595d2fbd4c65f5d1b28baa8fd96", Articlepager ("", "#", ""));
}
</script>
<%
if (1==1)
{
var myrows = myrows ("386d9595d2fbd4c65f5d1b28baa8fd96");
if (myrows!= null)
{
foreach (Var a in myrows)
{%>
<%=paging ("Articlelist", New string[,]{{"category", "#category"}},10,a[0])%>
<%
}
}
Else
{%><p style= ' margin:10px; ' > No relevant information </p><%
}
}%>

All in all, basically the binding data can be used.

Now my CMS to deal with the basic corporate web site, is more than enough, there are members of the function has yet to be developed.

has been a person alone development, technical use of the wrong place also please magnanimous, because personal technology is too superficial, hesitate whether open source.

Afraid of predecessors jokes, hehe, first send a paste to pasted.

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.