Valerie Meunier

Valerie Meunier

  • NA
  • 693
  • 82.6k

why namespace in windows forms but not in asp.net empty website?

Dec 28 2021 4:24 PM

Hi

I have compared windows formq app and asp.net empty website app and i have some questions:

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        internal static int a = 5;
    ...

private void button1_Click(object sender, EventArgs e)
    { ...

--------------------------------------

public partial class dropd: System.Web.UI.Page
{
    DropDownList dd1;
    ...

 protected void Button1_Click(object sender, EventArgs e)
    { ...

1) why no namespace in website app?
2) why no static variable in website, or why static variable in windows forms?
3) why must events like Button1_Click be protected and not private in website app while in windows forms, they are private?
Thanks

   


Answers (3)