<%@ Page Title="" Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="EditSinglePage.aspx.cs" Inherits="Portal.Admin.EditSinglePage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">








<div class="result-wrap">
       <div class="result-title">
                <h1>单页面Single Page</h1>
        </div>

        <table class="table">
         <tr>
         <th width=150px>类别名称</th>
         <td>
        <asp:TextBox ID="catname" runat="server"  CssClass="form-control"  Width=390></asp:TextBox>
         </td>
        </tr>
        
        <tr>
        <th>类别顺序</th>
        <td>
        <asp:TextBox ID="txt_orderid"  CssClass="form-control" runat="server" Text="0"></asp:TextBox> 
        
        </td>
        </tr>

        <tr>
        <td colspan="2">
        
        <div class="btnc">
         


    <asp:Button ID="btn_add" runat="server" Text="添加" onclick="Button1_Click" CssClass="btn btn-primary"/>

   <asp:Button ID="btn_back" runat="server" onclick="CancelBtn_Click" Text="返回" CssClass="btn"/>
    

        </div>
        </td>
        
        </tr>

        </table>


 


 

 
    
    

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
     GridLines="None" CssClass="table"  
        DataKeyNames="itemid" DataSourceID="SqlDataSource1">
      <Columns>
         
     
          <asp:BoundField DataField="itemid" HeaderText="ID号" InsertVisible="False" 
              ReadOnly="True" SortExpression="itemid"  ItemStyle-Width="90" />
          <asp:BoundField DataField="catname" HeaderText="类别名称" 
              SortExpression="catname" ItemStyle-Width="280" />
          <asp:BoundField DataField="orderid" HeaderText="顺序ID" 
              SortExpression="orderid" ItemStyle-Width="80"/>
          <asp:BoundField DataField="moduleid"  Visible="false"  HeaderText="moduleid" 
              SortExpression="moduleid" />
              
              
                <asp:TemplateField>
                <HeaderTemplate>页面内容</HeaderTemplate>
                 <ItemTemplate>
                          <a target=_blank  href="SingPage.aspx?itemid=<%#Eval("itemid") %>&mid=<%=Request.QueryString["mid"] %>&tabid=<%=Request.QueryString["tabid"] %>">查看或设定新闻</a>
                    </ItemTemplate>
              </asp:TemplateField>
                                           
                                           
                                           
                                           
     <asp:CommandField HeaderText="操作" EditText="编辑" DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "  UpdateText="更新"  CancelText="取消" ShowDeleteButton="True" ShowEditButton="True" />
     
        </Columns>
      
        
    
    </asp:GridView>
   
   
   
    <asp:SqlDataSource 
      ConnectionString="<%$ ConnectionStrings:ConnectionString %>"    
      ID="SqlDataSource1" 
      runat="server" 
        DeleteCommand="DELETE FROM [portal_singlepage] WHERE [itemid] = @itemid" 
        SelectCommand="SELECT * FROM [portal_singlepage]  where moduleid=@moduleid ORDER BY [orderid] asc " 
        
        UpdateCommand=" UPDATE [portal_singlepage] SET [catname] = @catname, [orderid] = @orderid WHERE [itemid] = @itemid" 
        onselecting="SqlDataSource1_Selecting">
       
       <SelectParameters>
          <asp:Parameter Name="moduleid" Type="Int32"  DefaultValue="0"/>
       </SelectParameters>
       
        <DeleteParameters>
            <asp:Parameter Name="itemid" Type="Int32" />
        </DeleteParameters>
       
        <UpdateParameters>
            <asp:Parameter Name="catname" Type="String" />
            <asp:Parameter Name="orderid" Type="Int32" />
            <asp:Parameter Name="itemid" Type="Int32" />
        </UpdateParameters>
       
    </asp:SqlDataSource>
    
    

 

</asp:Content>
