Я продолжаю получать ошибки о том, что все представления сетки и т. д. не существуют в текущем контексте. В приведенном здесь коде вы можете ясно видеть, что excelData определен:
Код: Выделить всё
public partial class Sales_Order_Check : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
excelData = new Dictionary(); // Initialize the dictionary
// Load Excel data into the dictionary
LoadExcelData();
}
}
// Example method to load Excel data (make sure this matches how you're reading the data)
private void LoadExcelData()
{
// Assuming you are reading data from an Excel file into this dictionary
excelData.Add("ORDERNO1", "5-100.00"); // Example key-value pair: ORDERNO - "quantity-actualCost"
// Add more entries based on your Excel data
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... -aspx-page