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,
Pop
JuanDG - 05 Dec 2004 17:17 GMT
It looks you either come from VB or Copied this code from a VB article,
because in C# you put the name of the session variable in brackets, not in
parenthesis like in VB, something like this:
Session["Login"]= true;
Cheers!!!!!
--
Juan David Gomez A.
Microsoft Certified Professional
Analista de Desarrollo - PSL S.A.
Web and Wireless Banking
Medellin - Colombia
> Hi alls,
> I'm writing a asp.net mobile web app.
[quoted text clipped - 27 lines]
> Best regards,
> Pop