ASP.NET Website's BIN directory and references

834

Solution 1

I think the problem may have to do with using a web site project, as oppossed to a Web Application. I can't remember off the top of my head, but there's something funky about the way web site projects are compiled, as oppossed to web application projects.

Solution 2

Here is a good article on your question Compilation and Deployment.

It has something to do with "WebSites" being compile at runtime. Hopefully the above article will answer your question.

Share:
834
nisreen al-madi
Author by

nisreen al-madi

Updated on June 04, 2022

Comments

  • nisreen al-madi
    nisreen al-madi almost 2 years

    I am trying to populate the checkbox I inserted into datagridview when the form load based on values I retrieved from the database, but it doesn't work.

    It's a vacation detailed form and it should give me all the vacation and if it is cycled or not.

    This is the code I wrote

    constr = conn.createNewConnection();
    
    da = new SqlDataAdapter(selectCommand, constr);
    
    ds = new System.Data.DataSet();
    da.Fill(ds,"vacation_tbl");
    vacGrid.DataSource = ds.Tables[0];
    vacGrid.Columns[2].Visible = false;
    
    vacGrid.Columns[0].HeaderText = "Vacation Code";
    vacGrid.Columns[0].Width = 100;
    vacGrid.Columns[1].HeaderText = "Vacation Name";
    vacGrid.Columns[1].Width = 100;
    //vacGrid.Columns[3].HeaderText = " System User";
    
    checkBoxColumn.HeaderText = "Is Cycled";
    checkBoxColumn.Width = 100;
    checkBoxColumn.Name = "cyclechbx";
    vacGrid.Columns.Insert(3, checkBoxColumn);
    
    int IsCycel;
    
    for(int i = 0; i < vacGrid.Rows.Count; i++)
    {
        IsCycel = Convert.ToInt32(vacGrid.Rows[i].Cells[2].Value);
    
        if (IsCycel == 1)
        {
            vacGrid["cyclechbx", i].Value = true;
        }
    }
    

    and this is what it results after run the code

    the is cycled should be ticked

    • wablab
      wablab almost 8 years
      Since you're binding to a DataTable, have you tried making the "IsCycled" column a calculated column using its 'Expression' property? Then you wouldn't have to execute the for loop to set it manually.
  • John Saunders
    John Saunders almost 11 years
    Web site projects are not compiled - not until runtime, that is. They're very strange and should be avoided due to that strangeness.
  • ProfK
    ProfK almost 11 years
    @JohnSaunders They are strange, and I hate and avoid them, but here at work they have one big advantage. Our system has been modified here and there for various clients, and sometimes we need a client to send us their web site, with source code. If the web site had been compiled, it would be a very long and sticky ride decompiling the DLL's. I know this from experience.
  • nisreen al-madi
    nisreen al-madi almost 8 years
    yes thank you i tried this and it worked after adding Boolean to DataTable the checkbox has been created automatically.