TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kasuni Abegunawardana
NA
211
124.9k
How to call a class into aspx.cs
Nov 22 2017 12:41 AM
Hi all this the class that what i have created. Plase i want it to call into my aspx.cs web form. How can i do that? I tried namespace.login; it dosen't work.
And i want to know how to call this class into the aspx.cs form.
Thank you.
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Web;
namespace Food_Calorie_Calculator__Final_Project.Account
{
public class Login
{
static string U_EmailAddress;
static string U_Password;
public string ID = string.Empty;
SqlConnection conn = Main.GetDBConnection();
public Login()
{ }
public Login(string _U_EmailAddress, string _U_Password)
{
U_EmailAddress = _U_EmailAddress;
U_Password = _U_Password;
}
public string getemailinfo
{
get
{
return U_EmailAddress;
}
}
public string getpassinfo
{
get
{
return U_Password;
}
}
public string Validation()
{
try
{
DataTable usertable = new DataTable();
string SQL = @"SELECT U_EmailAddress FROM User_tb where
U_EmailAddress ='" + U_EmailAddress + "' AND U_Password ='" + U_Password + "'";
SqlDataAdapter Userdataadapter = new SqlDataAdapter(SQL, conn);
Userdataadapter.Fill(usertable);
foreach (DataRow myrow in usertable.Rows)
{
ID = (myrow[0].ToString());
}
}
catch (InvalidCastException e)
{
throw (e); // Rethrowing exception e
}
return ID;
}
}
}
Reply
Answers (
3
)
How to add a message box into a class in asp.net web forms
chat application using signal r and login