cdiego

webforma1.aspx

Jul 13th, 2013
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 5.57 KB | None | 0 0
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="AppWeb.WebForm1" %>
  2. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  3.     <p>
  4.         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
  5.             CellPadding="4" DataKeyNames="IdProducto" DataSourceID="ObjectDataSource1"
  6.             ForeColor="#333333" GridLines="None">
  7.             <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
  8.             <Columns>
  9.                 <asp:CommandField ShowEditButton="True" />
  10.                 <asp:BoundField DataField="IdProducto" HeaderText="IdProducto"
  11.                     SortExpression="IdProducto" Visible="False" />
  12.                 <asp:TemplateField HeaderText="ID">
  13.                     <EditItemTemplate>
  14.                         <asp:Label ID="Label2" runat="server" Text='<%# Eval("IdProducto") %>'></asp:Label>
  15.                     </EditItemTemplate>
  16.                     <ItemTemplate>
  17.                         <asp:Label ID="Label1" runat="server" Text='<%# Eval("IdProducto") %>'></asp:Label>
  18.                     </ItemTemplate>
  19.                 </asp:TemplateField>
  20.                 <asp:BoundField DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre"
  21.                     Visible="False" />
  22.                 <asp:TemplateField HeaderText="Nombre">
  23.                     <EditItemTemplate>
  24.                         <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Nombre") %>'></asp:TextBox>
  25.                         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
  26.                             ControlToValidate="TextBox1" ErrorMessage="Nombre Requerido"></asp:RequiredFieldValidator>
  27.                     </EditItemTemplate>
  28.                     <ItemTemplate>
  29.                         <asp:Label ID="Label3" runat="server" Text='<%# Eval("Nombre") %>'></asp:Label>
  30.                     </ItemTemplate>
  31.                 </asp:TemplateField>
  32.                 <asp:BoundField DataField="Precio" HeaderText="Precio" SortExpression="Precio"
  33.                     Visible="False" />
  34.                 <asp:TemplateField HeaderText="Precio">
  35.                     <EditItemTemplate>
  36.                         <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Precio") %>'></asp:TextBox>
  37.                         <asp:RangeValidator ID="RangeValidator1" runat="server"
  38.                             ControlToValidate="TextBox2" ErrorMessage="Fuera de Rango" MaximumValue="10000"
  39.                             MinimumValue="10" Type="Currency"></asp:RangeValidator>
  40.                         <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
  41.                             ControlToValidate="TextBox2" ErrorMessage="Precio Requerido"></asp:RequiredFieldValidator>
  42.                     </EditItemTemplate>
  43.                     <ItemTemplate>
  44.                         <asp:Label ID="Label4" runat="server" Text='<%# Eval("Precio") %>'></asp:Label>
  45.                     </ItemTemplate>
  46.                 </asp:TemplateField>
  47.                 <asp:BoundField DataField="IdCategoria" HeaderText="IdCategoria"
  48.                     SortExpression="IdCategoria" Visible="False" />
  49.                 <asp:TemplateField HeaderText="Categoria">
  50.                     <EditItemTemplate>
  51.                         <asp:DropDownList ID="DropDownList1" runat="server"
  52.                             DataSourceID="ObjectDataSource2" DataTextField="NombreCat"
  53.                             DataValueField="IdCategoria" SelectedValue='<%# Bind("IdCategoria") %>'>
  54.                         </asp:DropDownList>
  55.                         <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
  56.                             SelectMethod="ListarTodo" TypeName="DAO.DAOCategoria">
  57.                         </asp:ObjectDataSource>
  58.                     </EditItemTemplate>
  59.                     <ItemTemplate>
  60.                         <asp:DropDownList ID="DropDownList1" runat="server"
  61.                             DataSourceID="ObjectDataSource2" DataTextField="NombreCat"
  62.                             DataValueField="IdCategoria" Enabled="False"
  63.                             SelectedValue='<%# Bind("IdCategoria") %>'>
  64.                         </asp:DropDownList>
  65.                         <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
  66.                             SelectMethod="ListarTodo" TypeName="DAO.DAOCategoria">
  67.                         </asp:ObjectDataSource>
  68.                     </ItemTemplate>
  69.                 </asp:TemplateField>
  70.             </Columns>
  71.             <EditRowStyle BackColor="#999999" />
  72.             <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  73.             <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  74.             <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  75.             <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
  76.             <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
  77.             <SortedAscendingCellStyle BackColor="#E9E7E2" />
  78.             <SortedAscendingHeaderStyle BackColor="#506C8C" />
  79.             <SortedDescendingCellStyle BackColor="#FFFDF8" />
  80.             <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
  81.         </asp:GridView>
  82.         <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
  83.             DataObjectTypeName="ENTIDADES.eProducto" SelectMethod="ListarTodo"
  84.             TypeName="DAO.DAOProducto" UpdateMethod="Actualizar"></asp:ObjectDataSource>
  85.     </p>
  86. </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment