Hello forum,
Please I'm trying to make my website in such a way that when somebody signs up or login, his or her username will be displayed from the database on to the next Web page where it's been redirected to. Like having a label that will display the information in
the middle of the navigation bar. The user profile will be used to make any transaction on the site.
Donald.
Here are my .cs and .aspx code below
Login.aspx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Login</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/StyleSheet.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.center-page {
width:300px;
height:300px;
position:absolute;
<div class="col-xs-11" style="margin-top: 20px; ma
Login.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Homepage : System.Web.UI.Page
{
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Dataregister.mdf;Integrated Security=True");
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Home</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/StyleSheet.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.navbar{
width:100%;
position:fixed!important ;
top:0px;
}
.footer {
width:100%;
position:fixed!important;
}
.container2{
width:100%;
}
.container{
width:100%;
}
slideimages()
</script>
</div>
<br /><br /><br />
<div class="container-fluid">
<div style="text-align: center;">
<img src="images/chain.png" alt="iphone" />
</div>
<h1 style="font-size: xx-large; font-family: Goudy Old Style; color: #200662; text-align: center; font-weight: bolder;">Curbing Fraud on All Angles</h1>
<p style="font-size: small; font-family: Verdana; text-align: center; width: 60%; margin: 1em auto 2em auto;">
The predominant discourse, familiar since from the 1990s, emphasizes infrastructure as one of the principal entities in a global
system of development. The process of moving a society from a traditional subsistent level towards a modern and scientific
stage is one of the most perplexing issues facing many nations in the developing world. What is at hand is a conflict between the
seemingly non-dynamic forces of traditions and the systematic growth orientation of modernization (Myrdal, 1970). Given these conditions, the
process of promoting development is essentially one of organizing and combining various elements in what Mosher terms the 'institutional
milieu' of development [1966. 1976]. These elements consist of a nation’s customs and traditions, ideology, physical resources and education.
</p>
</div>
<div class="container-fluid" style="background-color:#00003D;">
<h1 style="color:#eeeeee; text-align:center;">eFeatures</h1>
<div class="row" style="margin-left:0%;">
<div class="section">
<div class="col-md-4" style="border-style:groove; border-width:1px; border-radius:8px;"><br />
<img src="images/2018-Mercedes-Benz-C-300-Sedan.png" alt="Toyota-2016-Lineup" width="200" height="100"/>
<br /><br />
<h2 style="color:#eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">Car Verification</h2>
<p style="color:#eeeeee; width:70%;">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
</div>
<div class="col-md-4" style="border:thin solid #000000; border-color:white; border-radius:8px;"><br />
<img src="images/smartphone-png-1.png" alt="smartphone" width="100" height="100"/>
<br /><br />
<h2 style="color:#eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">Phone (IMEI) Verification</h2>
<p style=" color: #eeeeee; width:70%;">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
<div class="col-md-4" style="border-style:groove; border-width:1px; border-radius:8px; margin-right:0%;"><br />
<img src="images/red%20QR.jpg" alt="redqr" width="80" height="80"/>
<br /><br /><br />
<h2 style="color: #eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">QR Code Generation & Verification</h2>
<p style=" color:#eeeeee; width:80%;">Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Ut fermentum justo sit amet risus.</p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
</div><br /> <br />
</div>
<br /><br /> <br /><br />
<div class="container-fluid">
<div class="row">
<div class="form-horizontal col-md-6">
<div class="form-group">
<h1 style="font-size: x-large; color: #200662; margin-top: 4%; margin-left:20%; font-family: Co Headline Corp;">Why QR Code?</h1>
<p style="font-size: small; width: 60%; margin-left:20%; font-family: Lucida Sans Unicode">
QR Codes are 2D codes that data is embedded into
The QR stands for Quick Response. It has the capacity to store as many data as possible and can be used on all platforms
to curb fake - On Reciepts, Certificates, Identification cards, Tickets, and can also be used to make payment transactions.
The QR is the safest mode of information storage, as it cannot be reversed once generated, and are not the same.
</p>
</div>
</div>
<div class="col-md-6" style="margin-top:0%; margin-left:0%;">
<img src="images/Img%20QR.jpg" class="image-fluid" width="320" height="220" />
</div>
</div>
</div>
<br /><br /><br /> <br /> <br />
<div class="container-fluid" style="background-color:#eeeeee;"><br />
<h1 style="font-family:Tahoma; font-size:larger; text-align:center;">- Joscheck Authencity Drive -</h1>
<p style="font-family:AR CENA; font-size:medium; width:50%; margin-left:25%;">The predominant discourse, familiar since from the 1990s,
system of development. The process of moving a society from a traditional subsistent level towards a modern and scientific
stage is one of the most perplexing issues facing many nations in the developing world. What is at hand is a conflict between the
seemingly non-dynamic forces of traditions and the systematic growth orientation of modernization (Myrdal, 1970). Given these conditions, the
process of promoting development is essentially one of organizing and combining various elements in what Mosher terms the 'institutional
milieu' of development [1966. 1976]. These elements consist of a nation’s customs and traditions, ideology, physical resources and education.</p>
<br /><br /><br /><br />
</div>
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.Security;
using System.Xml.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
public partial class Admin : System.Web.UI.Page
{
SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
Accroding to your description and codes,could you tell us what is your problem?I create a demo of your codes,and when I click the login button,the textboxes of user's name and password hide.As far as I think,you could set textboxes null after session the
name.
protected void Page_Load(object sender, EventArgs e)
{
showdata();
}
public void showdata()
{
string str;
str = System.Configuration.ConfigurationManager.ConnectionStrings["aspnet-TestApplicationWithDatabase-20190820030542"].ConnectionString;
SqlConnection conn = new SqlConnection(str);
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from login where user_name='" + Session["user"] + "'";
cmd.Connection = conn;
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
sda.SelectCommand = cmd;
sda.Fill(ds);
user.Text = ds.Tables[0].Rows[0]["user_name"].ToString();
}
Result:
Best regards,
Yijing Sun
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Thank you Yij,
I want a situation where after login and taking you to the next page, the username profile of the user who just logged in will display on the navigation bar of the next page
Accroding to your description,I don't understand your reqirment clearly.Do you want to session user name and display on the navigation bar of the page header?
I suggest you could try this above answer.If the answer isn't your requirment,could you post the sample of the result you want to us?It will help us to solve your problem.
Best regards,
Yijing Sun
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Accroding to your description and codes,as far as I think,when you login and Redirect to Home page,you get the name and put the value in the user label text,like this:
public void showdata()
{
cmd.CommandText = "select * from Login where user_name='" + Session["user"] + "'";
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(ds);
user.Text = ds.Tables[0].Rows[0]["user_name"].ToString();
}
If you want to the label in the right top of the page,you could rejust the label position in the front.
Besides,accroding to your image,your error is that you need to replace the database connection to your own.
Result:
Best regards,
Yijing Sun
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
18 Points
98 Posts
User account profile
Apr 26, 2020 10:28 PM|Donald416|LINK
Please I'm trying to make my website in such a way that when somebody signs up or login, his or her username will be displayed from the database on to the next Web page where it's been redirected to. Like having a label that will display the information in the middle of the navigation bar. The user profile will be used to make any transaction on the site.
Donald.
Here are my .cs and .aspx code below
Login.aspx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Login</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/StyleSheet.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.center-page {
width:300px;
height:300px;
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
margin:auto;
}
</style>
</head>
<body style=" background-color:#DCDCDC; background-image: url('images/main.jpg'); background-size:cover; overflow-x:no-display;">
<form id="form1" runat="server">
<div class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation" style="background-color:#00003D; font-family:Nunito;">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" style="background-color:#00003D;border-color:white; border-width:1px;color:white">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" style="color: white">Login</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="JosCheck.aspx" style="color: #FFFFFF">| Home</a></li>
<li><a href="#" style="color: #FFFFFF">| About</a></li>
<li><a href="SignUp.aspx" style="color: #FFFFFF">| Sign Up</a></li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="center-page" style="margin-top: 10%; border: thin solid #000000; border-color: lightgray; border-radius: 8px; width: 40%;">
<div class="center-page">
<h1 style="font-size: x-large; font-family: Co Headline Corp; color: red;">Login</h1>
<p style="margin-top: -7%;">____________________________</p>
<br />
<div class="col-xs-11" style="margin-left: -12%;">
<asp:Label ID="Label1" ForeColor="#200662" runat="server" Font-Bold="true" CssClass="col-md-2 control-label" Text="USERNAME"></asp:Label>
<div class="col-xs-11">
<asp:TextBox ID="Username" CssClass="form-control" Width="350px" BorderStyle="None" runat="server" placeholder="Username"></asp:TextBox>
</div>
</div>
<div class="col-xs-11" style="margin-top: 20px; margin-left: -12%;">
<asp:Label ID="Label2" ForeColor="#200662" runat="server" Font-Bold="true" CssClass="col-md-2 control-label" Text="PASSWORD"></asp:Label>
<div class="col-xs-11">
<asp:TextBox ID="Password" CssClass="form-control" Width="350px" BorderStyle="None" runat="server" placeholder="Password" TextMode="Password"></asp:TextBox>
</div>
</div>
<div class="col-xs-11" style="margin-top: 20px; ma
Login.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Homepage : System.Web.UI.Page
{
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Dataregister.mdf;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
//Label7.Dispose();
// Label7.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Username.Text != "" & Password.Text != "")
{
string check = "select count(*) from [Login] where user_name = '" + Username.Text + "' and pass = '" + Password.Text + "' ";
SqlCommand com = new SqlCommand(check, con);
con.Open();
int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
con.Close();
if (temp == 1)
{
Username.Text = "";
Password.Text = "";
con.Open();
string user = Username.Text.Trim();
com.CommandText = "select * from Login where user_name='" + Username.Text + "'";
com.Connection = con;
sda.SelectCommand = com;
sda.Fill(ds, "detail");
if (ds.Tables[0].Rows.Count > 0)
{
Session["user"] = user;
Response.Redirect("Home.aspx");
con.Close();
}
}
else
{
Label7.ForeColor = System.Drawing.Color.Red;
Label7.Text = "Invalid Username or Password";
Username.Text = "";
Password.Text = "";
}
}
else
{
Label7.ForeColor = System.Drawing.Color.Red;
Label7.Text = "Empty Data";
}
}
}
Home.aspx :
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Home</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/StyleSheet.css" rel="stylesheet" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.navbar{
width:100%;
position:fixed!important ;
top:0px;
}
.footer {
width:100%;
position:fixed!important;
}
.container2{
width:100%;
}
.container{
width:100%;
}
.title {
line-height: 1.33;
letter-spacing: -.5px;
margin-bottom: 5px;
margin-top:0%;
}
.desc {
margin-bottom: 50px;
margin-top: 12px;
line-height: 1.7;
}
@media(min-width:992px){
.col-md-6:not(:first-child) {
}
.col-md-6:not(:last-child) {
border-right:1px solid #200662;
border-left:1px;
}
.form-horizontal {
line-height: 1.33;
letter-spacing: -.5px;
margin-bottom: 5px;
margin-top:0%;
}
}
</style>
<script type="text/javascript">
var image1 = new Image()
image1.src = "images/1.jpg"
var image2 = new Image()
image2.src = "images/alex-nemo-hanse-gA3YJpTWJSs-unsplash.jpg"
var image3 = new Image()
image3.src = "images/QR-lady-small-o.jpg"
</script>
</head>
<body style=" background-color:#DCDCDC; background-image:url('images/Dox.png'); overflow-x:hidden;">
<form id="form1" runat="server">
<div class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation" style="background-color: #00003D; font-family: Nunito;">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" style="background-color: #00003D; border-color:white; border-width:1px; color: white">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" style="color: white; font-family:Goudy Old Style;"><span><img alt="logo" src="images/JosCheck ic.jpg" height="30"/></span></a>
<a class="navbar-brand navbar-right"><asp:Label ID="user" runat="server" Text="User"></asp:Label></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="Home.aspx" style="color: #FFFFFF">| Home</a></li>
<li><a href="#" style="color: #FFFFFF">| About</a></li>
<li class="dropdwon">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"style="color: #FFFFFF">| Car<b class="caret"></b></a>
<ul class="dropdown-menu" style="background-color:#00003D;">
<li class="dropdown-header"><a href="VehicleRegistration.aspx" style="color: #FFFFFF; background-color:#00003D;">Register Vehicle</a></li>
<li class="dropdown-header"><a href="Report.aspx" style="color: #FFFFFF; background-color:#00003D;">Report</a></li>
<li class="dropdown-header"><a href="Verification.aspx" style="color: #FFFFFF; background-color:#00003D;">Verify Vehicle</a></li>
</ul>
</li>
<li class="dropdwon">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"style="color: #FFFFFF">| Phone<b class="caret"></b></a>
<ul class="dropdown-menu" style="background-color:#00003D;">
<li class="dropdown-header"><a href="PhoneRegistration.aspx" style="color: #FFFFFF; background-color:##00003D;">Register Phone</a></li>
<li class="dropdown-header"><a href="PhoneReport.aspx" style="color: #FFFFFF; background-color:#00003D;">Report</a></li>
<li class="dropdown-header"><a href="PhoneVerification.aspx" style="color: #FFFFFF; background-color:#00003D;">Phone Check</a></li>
</ul>
</li>
<li class="dropdwon">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"style="color: #FFFFFF">| QR Code <b class="caret"></b></a>
<ul class="dropdown-menu" style="background-color:#00003D;">
<li class="dropdown-header"><a href="QRGenerate.aspx" style="color: #FFFFFF; background-color:#00003D;">Generate QR Code</a></li>
<li class="dropdown-header"><a href="QRScan.aspx" style="color: #FFFFFF; background-color:#00003D;">Check QR Code</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container" style="margin-top:3.5%; width:100%; height:470px;background-size: 100% 100%;">
<img alt="" class="corner" id="img" src="images/homeimg.jpg" style="height: 120%; width: 105%; margin-left:-2%;" />
<div class="col-xs-11" style="margin-top: 0%; color:white;">
<h1 style="margin-top:-30%; font-size:large; font-family:AR CENA; text-align:right; margin-right:-2.5%; font-weight:bolder;">Connect with JosCheck to Curb fraud through our eSystem</h1>
<p style="margin-top: -0.5%; color:white; font-size:smaller; text-align:right; margin-right:-2%;">Guard against Theft. Register your Car and Phone. Verify with QR Code</p>
</div>
<script>
var step = 1
function slideimages() {
if (!document.images)
return
document.images.img.src = eval("image" + step + ".src")
if (step < 3)
step++
else
step = 1
setTimeout("slideimages()", 2500)
}
slideimages()
</script>
</div>
<br /><br /><br />
<div class="container-fluid">
<div style="text-align: center;">
<img src="images/chain.png" alt="iphone" />
</div>
<h1 style="font-size: xx-large; font-family: Goudy Old Style; color: #200662; text-align: center; font-weight: bolder;">Curbing Fraud on All Angles</h1>
<p style="font-size: small; font-family: Verdana; text-align: center; width: 60%; margin: 1em auto 2em auto;">
The predominant discourse, familiar since from the 1990s, emphasizes infrastructure as one of the principal entities in a global
system of development. The process of moving a society from a traditional subsistent level towards a modern and scientific
stage is one of the most perplexing issues facing many nations in the developing world. What is at hand is a conflict between the
seemingly non-dynamic forces of traditions and the systematic growth orientation of modernization (Myrdal, 1970). Given these conditions, the
process of promoting development is essentially one of organizing and combining various elements in what Mosher terms the 'institutional
milieu' of development [1966. 1976]. These elements consist of a nation’s customs and traditions, ideology, physical resources and education.
</p>
</div>
<div class="container-fluid" style="background-color:#00003D;">
<h1 style="color:#eeeeee; text-align:center;">eFeatures</h1>
<div class="row" style="margin-left:0%;">
<div class="section">
<div class="col-md-4" style="border-style:groove; border-width:1px; border-radius:8px;"><br />
<img src="images/2018-Mercedes-Benz-C-300-Sedan.png" alt="Toyota-2016-Lineup" width="200" height="100"/>
<br /><br />
<h2 style="color:#eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">Car Verification</h2>
<p style="color:#eeeeee; width:70%;">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
</div>
<div class="col-md-4" style="border:thin solid #000000; border-color:white; border-radius:8px;"><br />
<img src="images/smartphone-png-1.png" alt="smartphone" width="100" height="100"/>
<br /><br />
<h2 style="color:#eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">Phone (IMEI) Verification</h2>
<p style=" color: #eeeeee; width:70%;">Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
<div class="col-md-4" style="border-style:groove; border-width:1px; border-radius:8px; margin-right:0%;"><br />
<img src="images/red%20QR.jpg" alt="redqr" width="80" height="80"/>
<br /><br /><br />
<h2 style="color: #eeeeee; margin-top: 0; font-size: x-large; font-family:Arial Rounded MT; font-weight:bolder;">QR Code Generation & Verification</h2>
<p style=" color:#eeeeee; width:80%;">Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Ut fermentum justo sit amet risus.</p>
<p><a class="btn btn-primary" href="#" role="button">Read More »</a></p>
</div>
</div><br /> <br />
</div>
<br /><br /> <br /><br />
<div class="container-fluid">
<div class="row">
<div class="form-horizontal col-md-6">
<div class="form-group">
<h1 style="font-size: x-large; color: #200662; margin-top: 4%; margin-left:20%; font-family: Co Headline Corp;">Why QR Code?</h1>
<p style="font-size: small; width: 60%; margin-left:20%; font-family: Lucida Sans Unicode">
QR Codes are 2D codes that data is embedded into
The QR stands for Quick Response. It has the capacity to store as many data as possible and can be used on all platforms
to curb fake - On Reciepts, Certificates, Identification cards, Tickets, and can also be used to make payment transactions.
The QR is the safest mode of information storage, as it cannot be reversed once generated, and are not the same.
</p>
</div>
</div>
<div class="col-md-6" style="margin-top:0%; margin-left:0%;">
<img src="images/Img%20QR.jpg" class="image-fluid" width="320" height="220" />
</div>
</div>
</div>
<br /><br /><br /> <br /> <br />
<div class="container-fluid" style="background-color:#eeeeee;"><br />
<h1 style="font-family:Tahoma; font-size:larger; text-align:center;">- Joscheck Authencity Drive -</h1>
<p style="font-family:AR CENA; font-size:medium; width:50%; margin-left:25%;">The predominant discourse, familiar since from the 1990s,
system of development. The process of moving a society from a traditional subsistent level towards a modern and scientific
stage is one of the most perplexing issues facing many nations in the developing world. What is at hand is a conflict between the
seemingly non-dynamic forces of traditions and the systematic growth orientation of modernization (Myrdal, 1970). Given these conditions, the
process of promoting development is essentially one of organizing and combining various elements in what Mosher terms the 'institutional
milieu' of development [1966. 1976]. These elements consist of a nation’s customs and traditions, ideology, physical resources and education.</p>
<br /><br /><br /><br />
</div>
<footer>
<div class="container" style="background-color: #696969; height: 285px; margin-bottom:0px; font-family:Goudy Old Style; font-size:medium;">
<p class="pull-right"><a href="#" style="color: white;">Back to Top</a></p>
<p style="color: white;"><a href="Home.aspx" style="color: white;">Home</a> · <a href="#" style="color: white;">About</a></p>
<div class="container-fluid" style="text-align: center;">
<p style="color: white; font-size: medium; margin-top: 3%; margin-left:0%;">Contact Address: Nigerian Merit Award House</p>
<p style="color: white; font-size: medium;">Maitama District Abuja, F.C.T</p>
<p style="color: white; font-size: medium;">08138709222 08037445843 08023456781</p>
<asp:HyperLink ID="HyperLink5" runat="server" ImageUrl="~/images/facebook%20color.png" imagesize="20" NavigateUrl="http://www.facebook.com">HyperLink</asp:HyperLink>
<asp:HyperLink ID="HyperLink6" runat="server" ImageUrl="~/images/Gmail-icon.png" NavigateUrl="http://www.gmail.com">HyperLink</asp:HyperLink>
<asp:HyperLink ID="HyperLink7" runat="server" ImageUrl="~/images/linkedIn%20color.png" NavigateUrl="http://www.linkedin.com">HyperLink</asp:HyperLink>
<asp:HyperLink ID="HyperLink8" runat="server" ImageUrl="~/images/whatsapp%20green.png" image-size="30px" NavigateUrl="http://www.whatsapp.com">HyperLink</asp:HyperLink>
</div>
<br />
<br />
<p style="color: white; margin-bottom:-4%; font-weight:bold;">Copyright © 2020 Joscheck Tech. All Rights Reserved.</p>
</div>
</footer>
</form>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
Home.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.Security;
using System.Xml.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
public partial class Admin : System.Web.UI.Page
{
SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
con.ConnectionString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Dataregister.mdf;Integrated Security=True";
con.Open();
showdata();
}
public void showdata()
{
cmd.CommandText = "select * from Login where user_name='" + Session["user"] + "'";
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(ds);
user.Text = ds.Tables[0].Rows[0]["user_name"].ToString();
}
}
Contributor
3730 Points
1424 Posts
Re: User account profile
Apr 27, 2020 06:37 AM|yij sun|LINK
Hi Donald416,
Accroding to your description and codes,could you tell us what is your problem?I create a demo of your codes,and when I click the login button,the textboxes of user's name and password hide.As far as I think,you could set textboxes null after session the name.
More details,you could refer to below codes:
login.aspx:
login code-behind:
protected void Button1_Click(object sender, EventArgs e) { if (Username.Text != "" & Password.Text != "") { string str; str = System.Configuration.ConfigurationManager.ConnectionStrings["aspnet-TestApplicationWithDatabase-20190820030542"].ConnectionString; SqlConnection con = new SqlConnection(str); string check = "select count(*) from login where user_name = '" + Username.Text + "' and pass = '" + Password.Text + "' "; SqlCommand com = new SqlCommand(check, con); con.Open(); SqlDataAdapter sda = new SqlDataAdapter(); DataSet ds = new DataSet(); int temp = Convert.ToInt32(com.ExecuteScalar().ToString()); if (temp == 1) { string user = Username.Text.Trim(); com.CommandText = "select * from login where user_name='" + Username.Text + "'"; com.Connection = con; sda.SelectCommand = com; sda.Fill(ds, "detail"); if (ds.Tables[0].Rows.Count > 0) { Session["user"] = user; Username.Text = ""; Password.Text = ""; Response.Redirect("Home.aspx"); con.Close(); } } else { Label7.ForeColor = System.Drawing.Color.Red; Label7.Text = "Invalid Username or Password"; Username.Text = ""; Password.Text = ""; } } else { Label7.ForeColor = System.Drawing.Color.Red; Label7.Text = "Empty Data"; } }
Home.aspx:
Home code-behind:
Result:
Best regards,
Yijing Sun
Member
18 Points
98 Posts
Re: User account profile
Apr 27, 2020 03:20 PM|Donald416|LINK
I want a situation where after login and taking you to the next page, the username profile of the user who just logged in will display on the navigation bar of the next page
Contributor
3730 Points
1424 Posts
Re: User account profile
Apr 28, 2020 06:32 AM|yij sun|LINK
Hi Donald416,
Accroding to your description,I don't understand your reqirment clearly.Do you want to session user name and display on the navigation bar of the page header?
I suggest you could try this above answer.If the answer isn't your requirment,could you post the sample of the result you want to us?It will help us to solve your problem.
Best regards,
Yijing Sun
Member
18 Points
98 Posts
Re: User account profile
Apr 28, 2020 07:15 AM|Donald416|LINK
Hello Yijing,
thank you. I tried the above answer and this is what it came out with this if you check this you will see what i mean.
The first image shows a user's profile at the top right corner of the window where a user signed in; if you check there's a cursor on it.
https://imgur.com/a/10gBi1R
Thank you very much for your assistance.
Contributor
3730 Points
1424 Posts
Re: User account profile
Apr 28, 2020 08:50 AM|yij sun|LINK
Hi Donald416,
Accroding to your description and codes,as far as I think,when you login and Redirect to Home page,you get the name and put the value in the user label text,like this:
If you want to the label in the right top of the page,you could rejust the label position in the front.
Besides,accroding to your image,your error is that you need to replace the database connection to your own.
Result:
Best regards,
Yijing Sun
Member
18 Points
98 Posts
Re: User account profile
Apr 28, 2020 09:47 AM|Donald416|LINK
Thank you very much Yij sun, it worked well....