1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
| <%@ Page Title="EditContent" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EditContent.aspx.cs" Inherits="Pages_DefaultEditSettings" %>
<asp:content contentplaceholderid="head" runat="server">
</asp:content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<div>
<h2 class="header">Add/Edit Page</h2>
<div class="rightbtn">
<asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataSourceID="LinqDataSource2" DataKeyNames="Id_Name">
<%-- editing the page --%>
<EditItemTemplate>
<%-- RUNNING
<p>Content_No:
<asp:Label ID="PageIdLabel1" class="Label" runat="server" Text='<%# Eval("Content_No") %>' /> </p>
<p> Id Name:
<asp:TextBox ID="Page_NameTextBox" class="editbox" runat="server" Text='<%# Bind("Id_Name") %>' /> <br /></p>
<p> Page Id:
<asp:TextBox ID="TextBox1" class="editbox" runat="server" Text='<%# Bind("PageId") %>' /> <br /></p>
<p> Page Name:
<asp:TextBox ID="TextBox2" class="editbox" runat="server" Text='<%# Bind("Page_Name") %>' /> <br /></p>
<p> Text:
<asp:TextBox ID="TextBox11" class="editbox" runat="server" Text='<%# Bind("Text") %>' /> <br /></p>
--%>
<asp:Repeater runat="server" ID="Repeater1" DataSourceID="LinqDataSource2" EnableViewState="true">
<ItemTemplate>
<p> Content_No:
<asp:Label ID="PageIdLabel1" ClientIDMode="AutoID" class="Label" runat="server" EnableViewState="true" Text='<%# Eval("Content_No") %>' /> </p>
<p> Id Name:
<asp:Label ID="Label1" ClientIDMode="AutoID" class="Label" runat="server" EnableViewState="true" Text='<%# Bind("Id_Name") %>' /> <br /></p>
<p> Page Id:
<asp:TextBox ID="TextBox1" ClientIDMode="AutoID" class="editbox" runat="server" EnableViewState="true" Text='<%# Bind("PageId") %>' /> <br /></p>
<p> Page Name:
<asp:TextBox ID="TextBox2" ClientIDMode="AutoID" class="editbox" runat="server" EnableViewState="true" Text='<%# Bind("Page_Name") %>' /> <br /></p>
<p> Text:
<asp:TextBox ID="TextBox11" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Bind("Text") %>' /> <br />
</p>
</ItemTemplate>
</asp:Repeater>--%>
<asp:LinkButton ID="UpdateButton" class="updatebutton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" class="Updatecancelbutton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<EditRowStyle ForeColor="#CCCCCC" />
<%-- reading of page --%>
<ItemTemplate>
<asp:Repeater runat="server" ID="Repeater2" DataSourceID="LinqDataSource2">
<ItemTemplate>
<p> Content_No:
<asp:Label ID="PageIdLabel1" ClientIDMode="AutoID" class="Label" runat="server" Text='<%# Eval("Content_No") %>' /> </p>
<p> Id Name:
<asp:Label ID="Label1" ClientIDMode="AutoID" class="Label" runat="server" Text='<%# Eval("Id_Name") %>' /> <br /></p>
<p> Page Id:
<asp:TextBox ID="TextBox1" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Eval("PageId") %>' /> <br /></p>
<p> Page Name:
<asp:TextBox ID="TextBox2" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Eval("Page_Name") %>' /> <br /></p>
<p> Text:
<asp:TextBox ID="TextBox11" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Eval("Text") %>' /> <br />
</p>
</ItemTemplate>
</asp:Repeater>
<asp:LinkButton ID="EditButton" class="itembutton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
<asp:LinkButton ID="DeleteButton" class="itembutton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" />
<asp:LinkButton ID="NewButton" class="itembutton" runat="server" CausesValidation="False" CommandName="New" Text="New" />
</ItemTemplate>
<%-- add a new page on the website --%>
<InsertItemTemplate>
<asp:Repeater runat="server" ID="Repeater3" DataSourceID="LinqDataSource2" >
<ItemTemplate>
<p> Content_No:
<asp:Label ID="PageIdLabel1" ClientIDMode="AutoID" class="Label" runat="server" Text='<%# Bind("Content_No") %>' /> </p>
<p> Id Name:
<asp:Label ID="Label1" ClientIDMode="AutoID" class="Label" runat="server" Text='<%# Bind("Id_Name") %>' /> <br /></p>
<p> Page Id:
<asp:TextBox ID="TextBox1" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Bind("PageId") %>' /> <br /></p>
<p> Page Name:
<asp:TextBox ID="TextBox2" ClientIDMode="AutoID" class="editbox" runat="server" Text='<%# Bind("Page_Name") %>' /> <br /></p>
<p> Text:
<asp:TextBox ID="TextBox11" class="editbox" runat="server" Text='<%# Bind("Text") %>' /> <br /></p>
</ItemTemplate>
</asp:Repeater>
<asp:LinkButton ID="InsertButton" class="insertcheckbutton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" class="insertcheckbutton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<RowStyle ForeColor="#CCCCCC" />
</asp:FormView>
<%-- connexion database with request --%>
<asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="DataClassesDataContext" EnableViewState="true" EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName="" TableName="Content_Tables" Where="Page_Name == @Page_Name">
<WhereParameters>
<asp:QueryStringParameter DefaultValue="home" Name="Page_Name" QueryStringField="name" Type="String" />
</WhereParameters>
</asp:LinqDataSource>-->
</div>
</div>
</asp:Content> |
Partager