Session not allow in ASP.Net Mobile Web App? RRS feed

  • Question

  • User-1524525246 posted
    <color="#6633cc">Edited by SomeNewKid. Please post code between </color><color="#000000"><</color>code><color="#6633cc"> and </color><color="#000000"><</color>/code><color="#6633cc"> tags.</color>
    Hi alls, I'm writing a asp.net mobile web app. Here are the codes: try { myConn.Open(); myCmd.Connection=myConn; myCmd.CommandText = strSelect; myReader = myCmd.ExecuteReader(); myReader.Read(); if ( myReader.HasRows) { Session("StaffID") = myReader.GetValue(0); Session("Login") = true; Response.Redirect("MainMenu.aspx",false); }//end if else { Response.Redirect("LoginFail.aspx",false); }//end else }//end try it return me an error message like this: 'System.Web.UI.Page.Session' denotes a 'property' where a 'method' was expected This is the only error I get. Is it something wrong with my syntax or what?? Thanks in advance. Best regards, Pop830211
    Saturday, December 4, 2004 12:18 AM


  • User-95607119 posted
    If you are using C# then you should use Session["...."] instead of Sssion("...").
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, December 5, 2004 10:04 AM