Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="AppWeb.WebForm2" %>
- <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
- <p>
- <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"
- DataSourceID="ObjectDataSource3" DataTextField="NombreCat"
- DataValueField="IdCategoria">
- </asp:DropDownList>
- <asp:ObjectDataSource ID="ObjectDataSource3" runat="server"
- SelectMethod="ListarTodo" TypeName="DAO.DAOCategoria">
- </asp:ObjectDataSource>
- </p>
- <p>
- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
- CellPadding="4" DataKeyNames="IdProducto" DataSourceID="ObjectDataSource1"
- ForeColor="#333333" GridLines="None">
- <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
- <Columns>
- <asp:CommandField ShowEditButton="True" />
- <asp:BoundField DataField="IdProducto" HeaderText="IdProducto"
- SortExpression="IdProducto" Visible="False" />
- <asp:TemplateField HeaderText="ID">
- <EditItemTemplate>
- <asp:Label ID="Label2" runat="server" Text='<%# Eval("IdProducto") %>'></asp:Label>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:Label ID="Label1" runat="server" Text='<%# Eval("IdProducto") %>'></asp:Label>
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre"
- Visible="False" />
- <asp:TemplateField HeaderText="Nombre">
- <EditItemTemplate>
- <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Nombre") %>'></asp:TextBox>
- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
- ControlToValidate="TextBox1" ErrorMessage="Nombre Requerido"></asp:RequiredFieldValidator>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:Label ID="Label3" runat="server" Text='<%# Eval("Nombre") %>'></asp:Label>
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="Precio" HeaderText="Precio" SortExpression="Precio"
- Visible="False" />
- <asp:TemplateField HeaderText="Precio">
- <EditItemTemplate>
- <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Precio") %>'></asp:TextBox>
- <asp:RangeValidator ID="RangeValidator1" runat="server"
- ControlToValidate="TextBox2" ErrorMessage="Fuera de Rango" MaximumValue="10000"
- MinimumValue="10" Type="Double" Display="Dynamic"></asp:RangeValidator>
- <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
- ControlToValidate="TextBox2" ErrorMessage="Precio Requerido"
- Display="Dynamic"></asp:RequiredFieldValidator>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:Label ID="Label4" runat="server" Text='<%# Eval("Precio") %>'></asp:Label>
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="IdCategoria" HeaderText="IdCategoria"
- SortExpression="IdCategoria" Visible="False" />
- <asp:TemplateField HeaderText="Categoria">
- <EditItemTemplate>
- <asp:DropDownList ID="DropDownList1" runat="server"
- DataSourceID="ObjectDataSource2" DataTextField="NombreCat"
- DataValueField="IdCategoria" SelectedValue='<%# Bind("IdCategoria") %>'>
- </asp:DropDownList>
- <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
- SelectMethod="ListarTodo" TypeName="DAO.DAOCategoria">
- </asp:ObjectDataSource>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:DropDownList ID="DropDownList1" runat="server"
- DataSourceID="ObjectDataSource2" DataTextField="NombreCat"
- DataValueField="IdCategoria" Enabled="False"
- SelectedValue='<%# Bind("IdCategoria") %>'>
- </asp:DropDownList>
- <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
- SelectMethod="ListarTodo" TypeName="DAO.DAOCategoria">
- </asp:ObjectDataSource>
- </ItemTemplate>
- </asp:TemplateField>
- </Columns>
- <EditRowStyle BackColor="#999999" />
- <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
- <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
- <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
- <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
- <SortedAscendingCellStyle BackColor="#E9E7E2" />
- <SortedAscendingHeaderStyle BackColor="#506C8C" />
- <SortedDescendingCellStyle BackColor="#FFFDF8" />
- <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
- </asp:GridView>
- <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
- DataObjectTypeName="ENTIDADES.eProducto" SelectMethod="ListarPorCategoria"
- TypeName="DAO.DAOProducto" UpdateMethod="Actualizar">
- <SelectParameters>
- <asp:ControlParameter ControlID="DropDownList2" Name="IdCategoria"
- PropertyName="SelectedValue" Type="Int32" />
- </SelectParameters>
- </asp:ObjectDataSource>
- </p>
- </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment