Error 26 El nombre 'ListaPrecioDB' no existe en el contexto actual C:\Users\olcoba015\Documents\Fuentes\Marco15\Marco \WebSite\listaprecio.aspx.cs 19 15 C:\...\WebSite\
Tengo éste archivo ListaPrecioDB.cs
Código:
(Como hasta ahora estoy comenzando solo tengo el Add, en el momento solo me interesa insertar los registros)using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
namespace MarcoDB
{
public class ListaPrecioDB {
public ListaPrecioDB() {}
//inserta registros en la tabla lista de precio
public static int AddLista(int CodigoOperacion, DateTime FechaAplicacion, DateTime FechaFin)
{
SqlHelper.ExecuteNonQuery(SystemFramework.connString, "AddLista",
new SqlParameter("@CodigoOperacion", CodigoOperacion),
new SqlParameter("@FechaAplicacion", FechaAplicacion),
new SqlParameter("@FechaFin", FechaFin)
);
}
}
}
éste archivo lo llamo desde listaprecio.aspx.cs en el cual la línea ListaPrecioDB.AddLista(int.Parse(cboServicios.Sele ctedValue), txtFechaAplicacion.SelectedDate, txtFechaAplicacion.SelectedDate); me genera el error
Código:
y el archivo aspx es el sgt:using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using MarcoDB;
public partial class listaprecio : System.Web.UI.Page
{
protected void Button2_Click(object sender, EventArgs e)
{
try
{
ListaPrecioDB.AddLista(int.Parse(cboServicios.SelectedValue), txtFechaAplicacion.SelectedDate, txtFechaFin.SelectedDate);
lblError.Text = "Lista Grabada Ok";
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
protected void cboServicios_DataBound(object sender, EventArgs e)
{
cboServicios.Items.Insert(0, new ListItem("Seleccione Servicio", "0"));
}
}
Código HTML:
Ver original
<%@ Page Language="C#" MasterPageFile="~/MPMarco.master" AutoEventWireup="true" CodeFile="listaprecio.aspx.cs" Inherits="listaprecio" Theme="Marco" %> <%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <br /> <div style="text-align: center"> <table style="width: 720px"> <tr> <td class="titulosaplic" colspan="4"> Lista de Precios</td> </tr> <tr> <td class="Label" style="width: 100px; height: 22px"> Servicio</td> <td style="width: 224px"> <asp:DropDownList ID="cboServicios" runat="server" CssClass="text_normal" DataSourceID="PaisesDataSource" DataTextField="OperacionEspanol" DataValueField="IdOperacion" OnDataBound="cboServicios_DataBound" TabIndex="1"> </asp:DropDownList> </td> </tr> <tr> <td align="left" class="label" nowrap="nowrap" style="height: 22px" width="10%"> Desde</td> <td style="height: 22px; width: 224px;"> <radcln:raddatepicker id="txtFechaAplicacion" runat="server" width="115px"><DATEINPUT title="" CatalogIconImageUrl="" Description="" DisplayPromptChar="_" PromptChar=" " TitleIconImageUrl="" TitleUrl="" /></radcln:raddatepicker> </td> <td class="label" style="height: 22px"> Hasta</td> <td style="height: 22px"> <radcln:raddatepicker id="txtFechaFin" runat="server" width="115px"><DATEINPUT title="" CatalogIconImageUrl="" Description="" DisplayPromptChar="_" PromptChar=" " TitleIconImageUrl="" TitleUrl="" /></radcln:raddatepicker> </td> </tr> <tr> <td colspan="4"> <asp:Label ID="lblError" runat="server" EnableViewState="False" ForeColor="Red"></asp:Label></td> </tr> <tr> <td style="width: 264px"> <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Aceptar" /> <%--<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Cancelar" TabIndex="17" />--%> <%--<asp:Button ID="btnBorrar" runat="server" OnClick="btnBorrar_Click" Text="Eliminar" /></td>--%> <td class="Label" style="width: 224px; height: 26px"> </td> </tr> <tr> <td style="width: 100px; height: 26px"> <asp:SqlDataSource ID="PaisesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT IdOperacion, OperacionEspanol FROM dbo.Operaciones WHERE (IdOperacion = 1416) OR (IdOperacion = 1424) OR (IdOperacion = 1417) OR (IdOperacion = 1415) OR (IdOperacion = 1577) OR (IdOperacion = 1420) OR (IdOperacion = 1421) OR (IdOperacion = 1422) OR (IdOperacion = 1423) OR (IdOperacion = 1418) OR (IdOperacion = 1440)"></asp:SqlDataSource> </td> </tr> </table> </div> </asp:Content>
No se si es que hay un error que yo no veo, agradezco la ayuda que me puedan dar


