tehon3299 Posted February 23, 2003 Posted February 23, 2003 Can you reference session variables the same in C# as in VB? It seems to not like when I say: string user = Session("userName"); It says something about: CS0118: 'System.Web.UI.UserControl.Session' denotes a 'property' where a 'method' was expected and points to that line. Any ideas? Quote Thanks, Tehon
*Gurus* divil Posted February 23, 2003 *Gurus* Posted February 23, 2003 C# uses square brackets instead of parentheses for accessing Indexers and Arrays: string user = Session["userName"]; Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tehon3299 Posted February 23, 2003 Author Posted February 23, 2003 Thanks. I also figured out that I needed to convert it to a string by saying (string)Session["userName"]; Thanks again Quote Thanks, Tehon
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.