ASP.NET MVC案例教程(基於ASP.NET MVC beta)——第四篇:傳遞表單資料
阿新 • • 發佈:2019-02-16
1<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Release.aspx.cs" Inherits="MVCDemo.Views.Announce.Release"%> 2<%@ Import Namespace="MVCDemo.Models.Entities"%> 3
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5
6<html xmlns="http://www.w3.org/1999/xhtml"> 7<head runat="server"> 8 <title></title> 9</head>10<body>11 <% SelectList categories = ViewData["Categories"] as SelectList; %>12 <div>13 <h1>MVC公告發布系統——釋出公告</h1>14 <% Html.BeginForm( "DoRelease","Announce",FormMethod.Post); %>15 <dl>16 <dt>標題:</dt>17 <dd><%= Html.TextBox("Title") %></dd>18 <dt>分類:</dt>19 <dd><%= Html.DropDownList("Category",categories) %></dd>20 <dt>內容:</dt>21 <dd><%= Html.TextArea("Content") %></dd>22 </dl>23 <input type="submit" value="釋出"/>24 <% Html.EndForm(); %>25 </div>26</body>27</html>
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6<html xmlns="http://www.w3.org/1999/xhtml"> 7<head runat="server"> 8 <title></title> 9</head>10<body>11 <% SelectList categories = ViewData["Categories"] as SelectList; %>12 <div>13 <h1>MVC公告發布系統——釋出公告</h1>14 <% Html.BeginForm(