0

I'm trying to finish this website project, got everything fixed besides this:

namespace MillerDylanTwoColumn
{


protected void Page_Load(object sender, EventArgs e)
  {
    var lbl = sender as Label;
    lbl.Text = DateTime.Now.ToString();
  }

}

Does anyone know how to fix this?

curveball
  • 4,320
  • 15
  • 39
  • 49
  • Put your code in a `class`? – ProgrammingLlama Oct 16 '18 at 03:02
  • 1
    Possible duplicate of [A namespace cannot directly contain members?](https://stackoverflow.com/questions/37592507/a-namespace-cannot-directly-contain-members) – ProgrammingLlama Oct 16 '18 at 03:02
  • Hi, that fixed the error somehow (I tried before and it didn't.) But now it says: A default document is not configured for the requested URL, and directory browsing is not enabled on the server. What did I miss? – Dylan Skyler Miller Oct 16 '18 at 03:03
  • 1
    That I do not have an answer to, I'm afraid. – ProgrammingLlama Oct 16 '18 at 03:04
  • 2
    Not to be a turd but looking at the issue, hearing your new issue, and then telling us you have a website project... I think you're diving too far too fast. It's the best way to learn, IMO, but I'd take a few steps back and grab a book or two and work on the basics. If you do and look back you'll see what I'm saying. If not then I still encourage you to keep going and best of luck :) – Michael Puckett II Oct 16 '18 at 03:08
  • Page Load should be inside `public partial class MyPage : System.Web.UI.Page { }` – VDWWD Oct 16 '18 at 06:47

0 Answers0