Exemple #1
0
        protected void ButtonSearchPortfolio_Click(object sender, EventArgs e)
        {
            DropDownListStock.Items.Clear();
            DropDownListStock.DataSource = null;
            ListItem li = new ListItem("Select Stock", "-1");

            DropDownListStock.Items.Insert(0, li);

            //Session["STOCKPORTFOLIONAME"] = ddlPortfolios.SelectedValue;
            //Session["STOCKPORTFOLIONAME"] = ddlPortfolios.SelectedItem.Text;

            string[] scriptList = StockApi.getScriptFromPortfolioFile(ddlPortfolios.SelectedValue);
            if (scriptList != null)
            {
                foreach (string script in scriptList)
                {
                    li = new ListItem(script, script);
                    DropDownListStock.Items.Add(li);
                }
                labelSelectedSymbol.Text = "Selected stock: ";
            }
        }