Here's a program to build a news release system that doesn't have to deal with databases.
Steps:
(1). Create a new Web site in vs2005 and create a new three ASPX Web page named: title.aspx,news.aspx, Main.aspx which title.aspx used to set the title, you can design, write a few words also line, news.aspx used to display news headlines, main.aspx used to display news content.
(2). Create a new HTM page to design the framework. The code is as follows:
<title>无标题页</title>
<frameset border="0" bordercolor="#6699cc" framespacing="3" id="fsTop" rows="85,*">
<frame frameborder="no" marginheight="0" marginwidth="0" name="title" noresize scrolling="no" src="title.aspx" >
<frameset border="0" frameborder="1" framespacing="3" cols="110,*">
<frame frameborder="0" marginheight="0" marginwidth="0" name="dir" src="news.aspx" style="BORDER-RIGHT: #99ccff 1px solid; BORDER-TOP: #003366 1px solid" scrolling="auto" >
<frame bordercolor="#6699cc" frameborder="0" name="main" scrolling="yes" src="main.aspx?name=hello" style="BORDER-LEFT: #99ccff 2px groove; BORDER-TOP: #003366 1px solid">
</frameset>
</frameset>
(3). Now your program has no content, new XML file, named Contents.xml, used to display news headlines, the code is as follows:
<?xml version="1.0" encoding="GB2312"?>
<topiclist type="Dreamsite News">
<topic>
<title>欢迎进入千里之外的新闻网!</title>
</topic>
<topic>
<title>测试新闻</title>
</topic>
<topic>
<title> 第一条新闻</title>
</topic>
<topic>
<title> 第二条新闻</title>
</topiclist> Note that each of our news stories is an XML file, now you know what to do, create a new Hello.xml;test.xml;first.xml;dddd.xml file, give an example here, the code is as follows:
<?xml version="1.0" encoding="GB2312"?>
<document>
<title>今日新闻</title>
<abstract>头版新闻</abstract>
<author>千里之外</author>
<content><paragraph>大家好</paragraph></content>
</document>现在你就可以看到效果了,下面我们看一下发布新闻的代码,也很简单,新建manage.aspx页面,前台代码:
<body>
<form id="form1" runat="server">
<div>
<p>千里之外个人新闻发布系统</p>