473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Code for differentiating "Admins" from normal users not working

Hi Guys this is the Login Page with the snipped:

Expand|Select|Wrap|Line Numbers
  1. public int m = 0;
  2.             string user = Usernametxt.Text;
  3.             if (user.Equals("Admin"))
  4.             {
  5.                 m = 1;
  6.             }
  7.             else { m = 0; }

and another snipped on another form where:


Expand|Select|Wrap|Line Numbers
  1. private void HomePagefrm_Load(object sender, EventArgs e)
  2.        {
  3.            Loginfrm objLoginfrm = new Loginfrm();
  4.            //int z=objLoginfrm.m;
  5.            //int k=1;
  6.  
  7.            if (objLoginfrm.m==1)
  8.            {
  9.  
  10.               Register_btn1.Enabled = true;
  11.               Report_btn.Enabled = true;
  12.            }
  13.            else
  14.            {
  15.  
  16.                Register_btn1.Enabled = false;
  17.                Report_btn.Enabled = false;
  18.            }
  19.        }

However when i run this code i get the buttons disabled even for admin n
normal user's as well..
Please Help


i even tried
Expand|Select|Wrap|Line Numbers
  1. if (objLoginfrm.m==1)
  2.             {
  3.  
  4.                Register_btn1.Enabled = true;
  5.                Report_btn.Enabled = true;
  6.             }
but no...
Mar 14 '13 #1
0 1248

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

Similar topics

1
by: Nick Ashton | last post by:
Hi Whilst browsing the MSDN on day, I am sure I saw an article on 'How to encode your ASP code within the asp page', but I can not find it again. Can anyone help me please. If I remember the...
1
by: kevin | last post by:
its from a event in a flash doco which triggers the get URL with the java function in the html to open a new window:-)but I want just normal every functionallity browser window thanks santhi
1
by: Mike in Paradise | last post by:
I am trying to get the XML documentation working and I cannot get the <code> </code> block to work... <summary> works <remarks> works No way that I can get the <code> to work. The XML...
3
by: Suma | last post by:
Hi all, Is there any way from which we can find out if a window is opened as a modal window or as a normal window? I have a screen which opens as a normal window in one case and in other case...
7
by: group8perl | last post by:
I have this perl code written using Notepad which works fine using Apache but when i try to run the perl script on a Linix browser i get a program/script failure error. Can someone please help me...
1
by: David24 | last post by:
my best attempt to get the following code to store 2 ints representing the average location of x and y coordinates is throwing NullExeption errors. this is unsafe C# code by the way. i'm a novice so...
1
by: reemamg | last post by:
Have a piece of code which works in Firefox however doesnt work in IE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta...
1
by: sandhya karki | last post by:
How can we restrict an area from normal users and grant access only to a set area to normal user?
1
by: bhavanik | last post by:
I have a question about priviliges. My super user is "hyd" and I have other users like "kit" and "max". How can i give only select privileges to "kit" and "max" from duper user "hyd"?
1
by: joseph terzi | last post by:
I am trying to use recursion to calculate the nth prime. It works up until i believe around 300 when the interpreter says "maximum recusrion depth exceeded." Here is the code i wrote. def...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.