Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Mobile / December 2004

Tip: Looking for answers? Try searching our database.

Session not allow in ASP.Net Mobile Web App?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pop - 04 Dec 2004 05:15 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.