newcustomerw.aspx

来自「用VB实现」· ASPX 代码 · 共 109 行

ASPX
109
字号
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO Customers (Address, Birthday, city, CustomerID, CustomerName, eMail, Fax, Phone, Sex) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connSales") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connSales") %>'
Expression='<%# Request.Form("MM_insert") = "form2" %>'
CreateDataSet="false"
SuccessURL='<%# "newCustomerW.aspx" %>'
Debug="true"
>
  <Parameters>
    <Parameter Name="@Address" Value='<%# IIf((Request.Form("Address") <> Nothing), Request.Form("Address"), "") %>' Type="WChar" />
    <Parameter Name="@Birthday" Value='<%# IIf((Request.Form("Birthday") <> Nothing), Request.Form("Birthday"), "") %>' Type="Date" />
    <Parameter Name="@city" Value='<%# IIf((Request.Form("city") <> Nothing), Request.Form("city"), "") %>' Type="WChar" />
    <Parameter Name="@CustomerID" Value='<%# IIf((Request.Form("CustomerID") <> Nothing), Request.Form("CustomerID"), "") %>' Type="Integer" />
    <Parameter Name="@CustomerName" Value='<%# IIf((Request.Form("CustomerName") <> Nothing), Request.Form("CustomerName"), "") %>' Type="WChar" />
    <Parameter Name="@eMail" Value='<%# IIf((Request.Form("eMail") <> Nothing), Request.Form("eMail"), "") %>' Type="WChar" />
    <Parameter Name="@Fax" Value='<%# IIf((Request.Form("Fax") <> Nothing), Request.Form("Fax"), "") %>' Type="WChar" />
    <Parameter Name="@Phone" Value='<%# IIf((Request.Form("Phone") <> Nothing), Request.Form("Phone"), "") %>' Type="WChar" />
    <Parameter Name="@Sex" Value='<%# IIf((Request.Form("Sex") <> Nothing), Request.Form("Sex"), "") %>' Type="Boolean" />
  </Parameters>
</MM:Insert>
<MM:DataSet 
id="dsCustomer"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connSales") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connSales") %>'
CommandText='<%# "SELECT * FROM Customers" %>'
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>
</head>
<body>


<form method="post" name="form2" runat="server">
  <table align="center">
    <tr valign="baseline">
      <td nowrap align="right">Address:</td>
      <td><asp:textbox id="Address" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Birthday:</td>
      <td><asp:textbox id="Birthday" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">City:</td>
      <td><asp:textbox id="city" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">CustomerID:</td>
      <td><asp:textbox id="CustomerID" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">CustomerName:</td>
      <td><asp:textbox id="CustomerName" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">EMail:</td>
      <td><asp:textbox id="eMail" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Fax:</td>
      <td><asp:textbox id="Fax" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Phone:</td>
      <td><asp:textbox id="Phone" TextMode="SingleLine" Columns="32" runat="server" />
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Sex:</td>
      <td valign="baseline"><table>
          <tr>
            <td><% Sex.SelectedIndex = Sex.Items.IndexOf(Sex.Items.FindByValue(dsCustomer.FieldValue("Sex", Nothing).ToUpper()  )) %>
              <asp:RadioButtonList ID="Sex" runat="server">
                <asp:ListItem value="true">男性</asp:ListItem>
                <asp:ListItem value="false">女性</asp:ListItem>
              </asp:RadioButtonList>
</td>
          </tr>
      </table></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">&nbsp;</td>
      <td><input type="submit" value="插入记录"></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="form2">
</form>
<p>&nbsp;</p>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?