paperpublish.aspx
来自「用VB实现」· ASPX 代码 · 共 97 行
ASPX
97 行
<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<%
If not Len(Session("AdminID")) > 0 Then
Response.Redirect("login.aspx")
End IF
%><MM:Insert
runat="server"
CommandText='<%# "INSERT INTO newsPaper (npCatID, npContent, npTitle) VALUES (?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conn") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "newPaperList.aspx" %>'
Debug="true"
><Parameters>
<Parameter Name="@npCatID" Value='<%# IIf((Request.Form("npCatID") <> Nothing), Request.Form("npCatID"), "") %>' Type="WChar" />
<Parameter Name="@npContent" Value='<%# IIf((Request.Form("npContent") <> Nothing), Request.Form("npContent"), "") %>' Type="WChar" />
<Parameter Name="@npTitle" Value='<%# IIf((Request.Form("npTitle") <> Nothing), Request.Form("npTitle"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
<MM:DataSet
id="dsNewsPaper"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conn") %>'
CommandText='<%# "SELECT * FROM newsPaper" %>'
Debug="true"
></MM:DataSet>
<MM:DataSet
id="dsCat"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conn") %>'
CommandText='<%# "SELECT * FROM Cat" %>'
Debug="true"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加电子报刊</title>
<style type="text/css">
<!--
.style1 {
font-size: x-large;
font-weight: bold;
}
.style3 {font-size: x-large}
-->
</style>
</head>
<body>
<form method="post" name="form1" runat="server">
<table align="center">
<tr valign="baseline">
<td colspan="2" align="right" nowrap><div align="center" class="style1"><span class="style3">添加电子报刊 </span>
<hr>
</div></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">电子报刊主题:</td>
<td><asp:textbox id="npTitle" TextMode="SingleLine" Columns="50" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">电子报刊类别:</td>
<td><% npCatID.SelectedIndex = npCatID.Items.IndexOf(npCatID.Items.FindByValue(dsCat.FieldValue("CatID", Nothing) )) %>
<asp:dropdownlist id="npCatID"
DataSource="<%# dsCat.DefaultView %>"
DataTextField="CatName"
DataValueField="CatID"
runat="server"> </asp:dropdownlist>
</td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap>内容:</td>
<td><asp:textbox id="npContent" TextMode="MultiLine" Columns="50" runat="server" Rows="25" />
</td>
</tr>
<tr valign="baseline">
<td colspan="2" align="right" nowrap><hr></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?