PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/widgets/LinkList/edit.ascx

#
ASP.NET | 50 lines | 50 code | 0 blank | 0 comment | 0 complexity | ce52219b69e0ac1bdf5f1334b0686f60 MD5 | raw file
 1<%@ Control Language="C#" AutoEventWireup="true" CodeFile="edit.ascx.cs" Inherits="Widgets.LinkList.Edit" %>
 2<fieldset>
 3    <legend>Add new link</legend>
 4    <label for="<%=txtTitle.ClientID %>">
 5        <%=Resources.labels.title %></label>
 6    <asp:RequiredFieldValidator runat="Server" ControlToValidate="txtTitle" ErrorMessage="Please enter a title"
 7        ValidationGroup="add" /><br />
 8    <asp:TextBox runat="server" ID="txtTitle" Width="250px" />
 9    <asp:CheckBox runat="server" ID="cbNewWindow" Text="Open link in new window" />
10    <br />
11    <br />
12    <label for="<%=txtUrl.ClientID %>">
13        Website URL</label>
14    <asp:RegularExpressionValidator runat="Server" ControlToValidate="txtUrl" ValidationExpression="(http://|https://|)([\w-]+\.)+[\w-]+(/[\w- ./?%&=;~]*)?"
15        ErrorMessage="Please enter a valid URL" ValidationGroup="add" /><br />
16    <asp:TextBox runat="server" ID="txtUrl" Width="250px" Text="http://" />
17    <asp:Button runat="server" ID="btnAdd" Text="Add link" ValidationGroup="add" />
18</fieldset>
19<br />
20<asp:GridView runat="server" ID="grid" CellPadding="2" Width="100%" AutoGenerateColumns="False"
21    AlternatingRowStyle-CssClass="alt" AlternatingRowStyle-BackColor="#F1F1F1" AutoGenerateDeleteButton="True"
22    AutoGenerateEditButton="True">
23    <HeaderStyle HorizontalAlign="left" />
24    <Columns>
25        <asp:TemplateField HeaderText="<%$ Resources:labels, title %>">
26            <ItemTemplate>
27                <%# Eval("title") %>
28            </ItemTemplate>
29            <EditItemTemplate>
30                <asp:TextBox runat="server" ID="txtTitle" Width="90%" Text='<%# Eval("title") %>' />
31            </EditItemTemplate>
32        </asp:TemplateField>
33        <asp:TemplateField HeaderText="Website URL">
34            <ItemTemplate>
35                <%# Eval("url")%>
36            </ItemTemplate>
37            <EditItemTemplate>
38                <asp:TextBox runat="server" ID="txtUrl" Width="90%" Text='<%# Eval("url") %>' />
39            </EditItemTemplate>
40        </asp:TemplateField>
41        <asp:TemplateField HeaderText="New window">
42            <ItemTemplate>
43                <asp:CheckBox runat="server" Enabled="False" ID="cbNewWindow" Checked='<%# bool.Parse((string)Eval("newwindow")) %>' />
44            </ItemTemplate>
45            <EditItemTemplate>
46                <asp:CheckBox runat="server" ID="cbNewWindow" Checked='<%# bool.Parse((string)Eval("newwindow")) %>' />
47            </EditItemTemplate>
48        </asp:TemplateField>
49    </Columns>
50</asp:GridView>