cdiego

WebForm2.aspx

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