I'm coming from classic ASP and I did:
myVar = request.querystring("ID")
response.redirect("lol.asp");
And in .net it is:
myVar = Request.Querystring["ID"];
Response.Redirect("lol.aspx");
When are square brackets used over round ones? What do they signify? I'm sort of understanding it at the moment to represent an index?
Because ASP Classic is Visual Basic Script, which derives from Visual Basic syntax.
If you'd like to use ASP.NET with "round brackets", just switch to VB.NET in ASP.NET's code-behind.
"Round" or "square" brackets are an arbitrary, conventional syntax decision in VB.NET and C#.
UPDATE: I forgot to mention ASP Classic supports JScript too, so ASP classic with JScript would access to array indexes and, mainly indexers, with "square brackets". But it seems that question's author worked with ASP/VBScript :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With