Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > Session not allow in ASP.Net Mobile Web App?

Reply
Thread Tools

Session not allow in ASP.Net Mobile Web App?

 
 
Pop
Guest
Posts: n/a
 
      12-04-2004
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
 
Reply With Quote
 
 
 
 
JuanDG
Guest
Posts: n/a
 
      12-05-2004
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

"Pop" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone4,iPhone3,Ipad,Apple Mobile,Blackberry Mobile,HTC Mobile,LGMobile,Motorola Mobile,Nokia Mobile,Samsung Mobile chen selina C++ 0 07-13-2010 08:53 AM



Advertisments