I am running the following code on an ASP.NET razor page (cshtml) and am suffering the dreaded "Object reference not set to an instance of an object" problem. Could someone help me out with this problem? The code I'm using is below and the line causing the problem is menu[1][0] = "About";
string[][] menu = new string[5][];
menu[0] = new string[2];
// First menu item
menu[0][0] = "Home";
// First menu URL
menu[0][1] = "#";
// Second menu item
menu[1][0] = "About";
// Second menu URL
menu[1][1] = "#";
// Third menu item
menu[2][0] = "Contact";
// Third menu URL
menu[2][1] = "#";
// Fourth menu item
menu[3][0] = "More Info";
// Fourth menu URL
menu[3][1] = "#";
// Fifth menu item
menu[4][0] = "Test";
// Fifth menu URL
menu[4][1] = "#";
Thanks in advance