472,131 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

SmartPhone application in C#.NET

Ranjith Reddy Bandi
SmartPhone application in C#.NET
1. I have a login screen on mobile(Form1)..when user selects login it should take to another screen(Form2)...
2. how to pass session values from one form to other(in mobile application)
Jun 22 '07 #1
6 11164
Frinavale
9,735 Expert Mod 8TB
SmartPhone application in C#.NET
1. I have a login screen on mobile(Form1)..when user selects login it should take to another screen(Form2)...
2. how to pass session values from one form to other(in mobile application)
Hi Ranjith,

I have moved your thread from the Mobile Articles section to the Mobile Forums section. You should get more help now. The Articles section is reserved for "how-tos" and general information whereas the Forums section is where you are supposed to ask your questions. In the future, you'll receive better help if you ask your question in the right place (blue menu along the top: Forums->Mobile Development...or .NET...)

Thanks a lot!

-Frinny
Jun 22 '07 #2
RedSon
5,000 Expert 4TB
SmartPhone application in C#.NET
1. I have a login screen on mobile(Form1)..when user selects login it should take to another screen(Form2)...
2. how to pass session values from one form to other(in mobile application)
There are a few ways to do this. You can create global variables or you can expose class methods where one form can query another form's information. Or you can have one main state class that saves all the state.
Jun 25 '07 #3
manmis
1
Thanks it worked

I have created this class as Session.cs

[PHP]using System;
using System.Collections.Generic;
using System.Text;

namespace TrakBak
{
public class Session
{
public static global::System.Int16 UserID;

public static global::System.Int16 BatchID;

public static global::System.Int16 ItemID;

}
}[/PHP]

and then in the beginning of each Form I instantiate it as follows
[PHP]public global::TrakBak.Session Session = new Session();[/PHP]

later I can access the properties as follows:
[PHP]Session.BatchID=45;[/PHP]
Jan 23 '08 #4
markmcgookin
648 Expert 512MB
Or you could simply add it into the constructor and pass the variable at runtime:

Expand|Select|Wrap|Line Numbers
  1. public frmMyForm(int _number, bool _isNew)
  2.         {
  3.             InitializeComponent();
  4.             number = _number;
  5.             isNew = _isNew;
  6.         }
  7.  
  8. .....
  9.  
  10. //then when creating an instance
  11.  
  12. Form newForm = new frmMyForm(12, true);
  13. newForm.Show();
  14.  
Jan 28 '08 #5
LTCCTL
49
SmartPhone application in C#.NET
1. I have a login screen on mobile(Form1)..when user selects login it should take to another screen(Form2)...
2. how to pass session values from one form to other(in mobile application)

Hi,

I am also creating the same application, can you please send me the codes you have used...

Thanks in advance
Feb 16 '08 #6
Frinavale
9,735 Expert Mod 8TB
Hi,

I am also creating the same application, can you please send me the codes you have used...

Thanks in advance
Hi there,

Please take the time to research the problem before you post your question. The experts here are more than willing to help you with a specific problem but you have to do you part to learn the basics. Please take the time to read over the posting guidlines specifically the section on Before you post your question.

Thanks
-Moderator Frinny
Feb 16 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Andrew Banks | last post: by
1 post views Thread by MEGASILVER | last post: by
5 posts views Thread by Cooley | last post: by
reply views Thread by timsohn | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.