|
以下是我的newsAdminDetail.aspx的程式碼
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="newsAdminDetail.aspx.cs" Inherits="newsAdminDetail" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>新聞公告系統-管理</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <div> <table border="0" cellpadding="0" cellspacing="0" width="640" align="center"> <tr> <td> <img alt="" border="0" height="10" name="newsCenter_r1_c1" src="images/newsCenter_r1_c1.jpg" width="640" /></td> </tr> <tr> <td style="height: 60px"> <table align="left" border="0" cellpadding="0" cellspacing="0" width="640"> <tr> <td> <img alt="" border="0" height="60" name="newsCenter_r2_c1" src="images/newsCenter_r2_c1.jpg" width="188" /></td> <td> <table align="left" border="0" cellpadding="0" cellspacing="0" width="452"> <tr> <td align="right" background="images/newsCenter_r2_c2.jpg" class="nav" height="45" valign="bottom" width="452"> <img align="absMiddle" src="images/board_mark_list.gif" /> <a class="nav" href="newsAdmin.aspx">回管理主畫面</a> <img align="absMiddle" src="images/board_mark_list.gif" /> <asp:LoginStatus ID="LoginStatus2" runat="server" CssClass="nav" LogoutAction="Redirect" LogoutPageUrl="~/news.aspx" /> </td> </tr> <tr style="font-size: 12pt; color: #000000"> <td> <img alt="" border="0" height="15" name="newsCenter_r3_c2" src="images/newsCenter_r3_c2.jpg" width="452" /></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr style="font-size: 12pt; color: #000000"> <td align="center" background="images/newsCenter_r4_c1.jpg"> <asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate> <br /> <img align="absMiddle" src="images/icon_stop.gif" />請您先執行 <asp:LoginStatus ID="LoginStatus1" runat="server" /> 動作!<br /> <br /> </AnonymousTemplate> <LoggedInTemplate> <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BorderWidth="0px" Caption="新聞資料管理" CellPadding="4" CellSpacing="1" CssClass="Forumline" DataKeyNames="news_id" DataSourceID="AccessDataSource1" DefaultMode="Edit" Height="50px" Width="95%"> <CommandRowStyle HorizontalAlign="Center" /> <RowStyle CssClass="row1" HorizontalAlign="Left" /> <FieldHeaderStyle CssClass="row3" Font-Bold="True" HorizontalAlign="Center" Width="80px" /> <Fields> <asp:TemplateField HeaderText="類別"> <EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("news_type") %>'> <asp:ListItem Selected="True">系辦公告</asp:ListItem> <asp:ListItem>學術活動</asp:ListItem> <asp:ListItem>學會公告</asp:ListItem> <asp:ListItem>徵才</asp:ListItem> <asp:ListItem>其他</asp:ListItem> </asp:DropDownList> </EditItemTemplate> <InsertItemTemplate> <asp:DropDownList ID="DropDownList2" runat="server"> <asp:ListItem>系辦公告</asp:ListItem> <asp:ListItem>學術活動</asp:ListItem> <asp:ListItem>學會公告</asp:ListItem> <asp:ListItem>徵才</asp:ListItem> <asp:ListItem>其他</asp:ListItem> </asp:DropDownList> </InsertItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="日期"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("news_date") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# DateTime.Now %>'></asp:Label> </InsertItemTemplate> </asp:TemplateField> <asp:BoundField DataField="news_subject" HeaderText="標題" SortExpression="news_subject" /> <asp:BoundField DataField="news_editor" HeaderText="編輯者" SortExpression="news_editor" /> <asp:TemplateField HeaderText="內容"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Height="100px" Text='<%# Bind("news_content") %>' TextMode="MultiLine" Width="450px"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Height="100px" Text='<%# Bind("news_content") %>' TextMode="MultiLine" Width="450px"></asp:TextBox> </InsertItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" ShowInsertButton="True" /> </Fields> <AlternatingRowStyle CssClass="row2" /> </asp:DetailsView> </LoggedInTemplate> </asp:LoginView> </td> </tr> <tr style="font-size: 12pt; color: #000000"> <td> <img alt="" border="0" height="25" name="newsCenter_r5_c1" src="images/newsCenter_r5_c1.jpg" width="640" /></td> </tr> </table> </div> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/news.mdb" DeleteCommand="DELETE FROM [newscenter] WHERE [news_id] = ?" InsertCommand="INSERT INTO [newscenter] ([news_type], [news_subject], [news_content], [news_editor]) VALUES (?, ?, ?, ?)" SelectCommand="SELECT * FROM [newscenter] WHERE ([news_id] = ?)" UpdateCommand="UPDATE [newscenter] SET [news_type] = ?, [news_date] = ?, [news_subject] = ?, [news_content] = ?, [news_editor] = ? WHERE [news_id] = ?" OnUpdated="AccessDataSource1 Updated" OnInserted="AccessDataSource1_Inserted"> <SelectParameters> <asp:QueryStringParameter Name="news_id" QueryStringField="news_id" Type="Int32" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="news_id" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="news_type" Type="String" /> <asp:Parameter Name="news_date" Type="DateTime" /> <asp:Parameter Name="news_subject" Type="String" /> <asp:Parameter Name="news_content" Type="String" /> <asp:Parameter Name="news_editor" Type="String" /> <asp:Parameter Name="news_id" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="news_type" Type="String" /> <asp:Parameter Name="news_subject" Type="String" /> <asp:Parameter Name="news_content" Type="String" /> <asp:Parameter Name="news_editor" Type="String" /> </InsertParameters> </asp:AccessDataSource> </form> </body> </html>
請問哪裡出了問題嗎? 感激不盡...請幫幫忙 >0< |