A full-featured column management program-> This is the second application of asp.net (i)

Source: Internet
Author: User
A full-featured column management program-> This is the second application of asp.net (i)
/*
Tofu production, are fine
Http://www.asp888.net Tofu Technology Station
If reproduced, please retain the full copyright information
*/

Objective:
In front of the tofu will be a asp.net version of the message version of the program, today, and then refer to the example of a asp.net version of the column management program, the column is now almost become a technical site of a reserved column, tofu in the beginning to build the station originally wanted to break the tradition, but finally found Yes, it's a column. This form of program is appropriate for technology-class sites

Through the previous message version of the article, a lot of people reflect this reference to the example learning effect is very good, so I deliberately wrote this serial

First of all, it should be the entry of the column content, we look at the column should generally include what content? There should be the author of the column, the category of the column and the type of column published (original, reprint, etc.), and of course, the topic of the column and the content of the article.

We first look at add.aspx this file, this file is a special entry interface, where in addition to the use of our common in the ASP <input type=. > and so on HTML elements, but also used in the article on the server to save a certain amount of time in the information has been pagelet element <asp:dropdownlist&gt, because there are users in the message version of the program after the comments, request tofu
More use of some asp.net characteristics, here we through this program, we can asp.net in the practical application of a glimpse of:
Add.aspx:
<!--#include file= "func.aspx"-->
<script language= "VB" runat=server>
Sub Page_Load (Src as Object, E as EventArgs)
Dim DBRead as SqlDataReader
Dim Dbcomm as SQLCommand
Dim strSQL as String
Dim conn As SqlConnection
conn = Getconn ()
Strsql= "SELECT * from Lanmuclass ORDER by ClassID"
Dbcomm = New SQLCommand (strsql,conn)
DbComm.ActiveConnection.Open ()
Dbcomm.execute (DBRead)
While Dbread.read ()
SelClass.items.add (New ListItem (Dbread.item ("classname"), Dbread.item ("ClassID"))
End While
End Sub
</script>
<title> Add articles </title>
<%=grabpage ("/inc/head.inc")%>
<link rel= "stylesheet" type= "Text/css" href= "/doufu.css" >
<body>
<!--advertising starts-->
<%=grabpage ("/inc/ad.inc")%>
<!--advertising end-->
<form action= "Dosaveadd.aspx" method=post>
<p align=center>
<table border=1 width=80%>
<tr>
&LT;TD nowrap width=25%> Your code </td>
&LT;TD width=25%><input type=text size=10 maxlength=20 name= "Txtuserid" ></td>
&LT;TD width=15%> Your password </td>
&LT;TD ><input type=password size=10 maxlength=20 name= "Txtpass" ></td>
</tr>
<tr>
&LT;TD nowrap> Article Categories </td>
&LT;TD colspan=3>
<asp:dropdownlist id= "Selclass" runat= "Server"/>
The user who publishes the article and <a href= "Http://www.asp888.net/bbs" Target=_target title= "discuss learning here" > Forum </a> Users are consistent, registered users please go to <a href= "Reguser.asp" > here </a>
</td>
</tr>
<tr>
&LT;TD nowrap> article provenance </td>
<td>
<select name= "Selfrom" >
<option value= "original" > Original </option>
<option value= "reprint" > Reprint </option>
<option value= "translation" > Translation </option>
<option value= "Data Collation" > Data collation </option>
</select>
</td>
&LT;TD colspan=2> Article if it is reproduced, please abide by the original author of the copyright Agreement </td>
</tr>
<tr>
<td> title of the article </td>
&LT;TD colspan=3>
<input type=text size=25 maxlength=300 name= "Txttitle" >
<input type=submit value= "OK" >
</td>
</tr>
<tr>
<td> the content of the article </td>
&LT;TD colspan=3><textarea name= "txtcontent" cols=80 rows=30></textarea></td>
</tr>
</Table>

</p>

</form>
</body>
Notice that in this I also used the same include statement as the ASP syntax, and it is true that the syntax of the include in ASP.net is completely consistent with the syntax in the ASP, and we do notice that the func.aspx we included in this program The file should be a function package.
, I'll explain the contents of this function package in the next 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.