Link to home
Start Free TrialLog in
Avatar of thomasmutton
thomasmuttonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.NET C# external classes

Hello

I am trying to make my own login with asp.net as i do not have MS SQL

i have made it, and am wanting to use external classes. i am however finding it difficult to return values back to the original page..

this is the external class for instance.

public class Login
{
      public static string CartInfo(string username, string password)
      {
           //here i wanto recieve the username and password then send out a bool to say if it is true or false
        }
}

and this is my web page code.

public void hello(string tom, string iscorrect)
        {
              // here i wanto send the username and password information from the session
               // to the external class by code below...
                                                
            Login.CartInfo(username);
            Login.CartInfo(password);

//then recieve the bool and make a decision based on that.
        }


i am familair with classes just not the returning of values.
Avatar of craskin
craskin
Flag of United States of America image

just create a function in your custom namespace and class that returns the boolean. then, on your page, you can just call it like

Dim LoginTrue As Boolean = myNamespace.MyClass.LoginTest(usernameSent, passwordSent)
ASKER CERTIFIED SOLUTION
Avatar of sankarbha
sankarbha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thomasmutton

ASKER

Excellent! thankyou sankarbha.