Show User Specific Data From Database Based On LoginID Username?

Jan 21, 2011

I am attempting to convert an online game i have written in ASP into ASP.NET,, but I am failing at a very early and probably a very amateurish stage.

I am using a Sample ASPX project. There is an ASPNETDB database included, when i register my username is added to the DB along with a userID and various other fields. This is stored in a table called aspnet_Users.

The Login Control is stored in a Site.Master file

<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"
onviewchanged="HeadLoginView_ViewChanged">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>

I have created a new table called tblClubs, which stores information such as ClubName, StadiumCapacity etc
I added a field called 'Owner' and this is directly related to the UserName field in the aspnet_Users table

What I am trying to solve is to show user specific information from the database, based on their LoginID.

i.e

My username is Laclerque and my club is called Racing Mongoose, the stadium capacity is 9500.. the information for each User needs to be different and just show the information that is relevant to them.

obviously in the longer term, there is going to be 100's of these associations required for the full game, but not until i can get my head around the basics of how to set this information. I tend to work better when i can see a working sample, and then adapt things to suit my needs.

View 1 Replies


Similar Messages:

User Controls :: Show Hide Specific Section Of Page Based On User Type Or Role

May 7, 2015

I have LOGIN PANEL for student, and I want to disable it in different page. And only the admin can enable and disable it. I dont know the logic behind here.

View 1 Replies

Web Forms :: Show User Specific Data From Database After Login?

Jun 19, 2010

in my project admin will create user and insert users data into database user can just view it by his login id.only logedin iser related data will be displayed on his page.

here admin has to fill fields as below for each user and create uid and password for that user and wen user will log in only data related to him will be displayed.

id,name,address,city,salary

userview

name ,address,city,salary of his own not othr persons.

View 3 Replies

Web Forms :: Display User Specific Information From Database - Based On Login ID

Jan 7, 2011

I have a online game (written in ASP) which i have finally decided to convert to ASP.NET. However i cannot seem to link the login ID's of users to their specific details in the database. I.E when Joe Bloggs logs in, he will be shown the team information for just his club, not every club. in ASP I use code similar to this below

[Code]....

im not convinced that is the right syntax to be using, but when i execute the code in Query Builder it is showing me the correct data (that i expect to see). So im wondering if there is something else im missing? Is there something extra that i need to be adding in Web.Config file or elsewhere?

View 30 Replies

Architecture :: Accessing Different Database Based On The Username

Dec 1, 2010

I am working on a website where when the user logs in, I select their database based on their username. Currently I have a list of all databases in the web.config and I select the Database ID from the username and then read the database string from web.config. What is the most optimal way to implement this scenario?

currently I:

- store the Database ID in the session object

- the Session object expires after like 5 minutes so i have to read the Database ID from the online database based on the username and regenerate the Session["DatabaseID"] again.

- there are some security issues with the Session ID, so I started clearing the Session in !(Page.IsPostBack) and I generate the Database string again.

Where shall I store the DatabaseID and the database connection string so I can easily reuse it once the user has logged in?

View 8 Replies

Security :: How To Show Data Based On User Name And Password

Apr 7, 2010

I would like to know how to show data based on user name and password?

Example:

User name: user1
Password: pass1

How to show information regarding the name user1 and pass1 (Students, teachers, etc...)?

[Code]....

View 6 Replies

Fetch Password From Database Based On Login Username

Jul 10, 2013

I want to show the password from database into Label,I have wright code following

SqlConnection con = new SqlConnection(@"Data Source=TEGADEV1SQL2K5EXPR;Initial Catalog=mydatabase;Integrated Security=True;Pooling=False"); SqlCommand cmd = new SqlCommand("select password from reg where username='" + username + "'", con);

cmd.Parameters.AddWithValue("@username", username); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt);

Lable.Text=......

I have use datatable how to read data from above code what will be the code wright Lable.Text=...

View 1 Replies

Database - How To Save User Specific Data In Site

Jun 1, 2010

I just set up user profiles using asp.net 3.5 using wvd. For each user I would like to store data that they will be updating every day. For example, every time they go for a run they will update time and distance. I intend to allow them to also look up their history of distance and time from any past date. My question is, what does the database schema usually look like for such a set up? Currently asp.net set up a db for me when I made user profiles. Do I just add an extra table for every user? Should there be one big table with all users data? How do I relate a user I'd to their specific data? Etc.

View 2 Replies

Web Forms :: Get User List Based On Specific Profile Property

Sep 4, 2010

I am trying to query a DB and get a list of users based on a specific boolean property stored in the aspnet_profile for that user. I am aware that it wasn't possible a few years ago [URL] but was wondering whether that had changed in recent releases, or it was still not possible without trawling through the entire list of users and testing them one by one. (My DB may become way to big for that.)

View 3 Replies

Security :: How To Redirect To Specific Page Based On User Roles

Sep 12, 2010

I am using Formsauthentication. My situation is as per below:

the login form has codebehind :

protected void LoginButton_Click(object sender, EventArgs e)
{
TextBox uname = Login1.FindControl("UserName") as TextBox;
TextBox pass = Login1.FindControl("Password") as TextBox;
CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;
Literal fail = Login1.FindControl("Literal1") as Literal;
if (Membership.ValidateUser(uname.Text, pass.Text))

[Code].....

Now the problem is that when I try to login with proper credentials it first redirects to default.aspx( there is no such page in my project), after login again with same credentials it properly redirects to the correct page. Why such problem arises? to fix this?

View 6 Replies

Security :: Redirect User Based On Role To Specific Web Page?

Apr 22, 2010

I'm not sure if this is possible or not, I'm using Roles to limit what pages a user can access based on there assigned Role. My question, is there anyway to redirect the user to a specific web page based on thier role after they login.

For example:

If Bob logs in with Role="Automotive", I want him to be redirected to Auto.aspx.If sue logs in with Role="Clothing", i want her to be redirected to cloths.aspx.

View 8 Replies

Data Controls :: Show Or Hide Image Control In GridView Based On Condition From Database

Dec 19, 2012

i am using template field display image based on condition in table field. i have field name  verify i used to store yes or no value if it is yes then display image else noting to display in gridview

View 1 Replies

Show Button For Specific User And Hide It For Another?

Dec 28, 2010

how can I show button for specific user and hide it for another one based on security role in ASP.NET MVC 2.

For example if I have Create button in my view how to show it only for admin and hide it for any other user.

View 1 Replies

Security :: Forms Based Authentication Allow Only Specific Users From Database Table?

Oct 1, 2010

I have the following implementation and I'm sure there is an easy way to do what I want to do but I can't figure it out.

1. I use forms based authentication to authenticate to my site

2. I use active directory to authenticate the users

3. I use the Allow Users="xxx" tag to authorize the users limited to the list that can access my site. (e.g.. even though Mary is an AD user she can't access my site unless I put her credentials in the allow users tag in the web.config file)

All is working well but I want to move the users access list (e.g.. <allow users="john" />" from the web.config to a database table so that I can create a user maintenance page for my admins to add and delete user access. For the life of me I can't figure out how to do this and I can't seem to find an article on it either.

[code]....

View 1 Replies

Migrate Existing Database From Specific Application To New Ms Access Based Application (database)?

Aug 2, 2010

how to migrate an existing database from a specific application to a new Ms Access based application(database)?

View 4 Replies

Security :: Associate A Specific User To A Specific Data On The Site?

Mar 14, 2010

I am trying to figure out how to associate a specific user to a specific data on the site, like social networking site.

View 3 Replies

AJAX :: Show Alert Message Notification On Specific Dates From Database

May 7, 2015

In my table me save data like this

name date place

celv 01/07/2014 Karaikudi

 me fetch the data from sql and show it in a new window   

but today date is 25/06/2014 i need to show the msg on 01/07/2014 after login in our application.

View 1 Replies

Security :: How To Show A Warning Popup When User Is Not Authorized To Access A Specific Folder

Feb 16, 2011

I am implementing membership provider. For example, anonymous users are not allowed to acces pages under the folder, namely XXX.

When user clicks to navigate any of those pages I would like to display a popup window. I know I can implement button clikc events. But there are many buttons and links. What is the most effective way to do that?

View 8 Replies

Web Forms :: User For Sign Up Page With Same Username In Database

Jun 29, 2012

I'm currently doing sign up page where customer can sign up to use my website.however, when they type username, they will prompt that username is taken.how to check in database if the username is already been taken? i got 2 sign up page. 1st page is where the customer type their username, and password.2nd page is where they type thier personal particulars and then it will store in database..

below are my codes fot my 1st page

protected void btnNext_Click(object sender, EventArgs e)  { 
if (!Page.IsValid) {               
return;           
}  Session["username"] = tbNewId.Text;  
Session["password"] = tbConfirmPassword.Text; 
Response.Redirect("~/SignUp2.aspx");      }

this is my codes for second page

protected void btnNext_Click(object sender, EventArgs e) {
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;
String sql = "Insert into Customer (Name, Phone, Email, Address, Username, Password) ";
sql = sql + "Values (@Name, @Phone, @Email, @Address, @Username, @Password)";

[code]....

View 1 Replies

Security :: How To Record Logged-on User's Username To Table In SQL Database

Mar 24, 2010

I have set up security on my ASP.NET site and currently have 1 user (soon to be more!). I would like to send the logged-on user's username to a variable, to input this value to a custom-designed stored procedure on my SQL database (for recording search statistics).Does anyone know how I can harness the current logged-on users username? I am using VB. Will the following achieve the result?session(username)If so, how do I implement this? I tried using "Current_User" in the SQL stored procedure, but obviously this did not record the ASP.NET user. Also, if the current user has not logged onto the site, I would like the "username" value to be "annonymous".

View 10 Replies

C# - Show Or Hide A Button Based On User Action?

Mar 14, 2011

Well I have a web page asp.net(page1.aspx) amm user can choose two options A/B if user chooses a when he is in page2.aspx i want a javascript was execute

function(receive parameter)
{
}

But if he chose option B function never will be executed. I want to do, if user chooses A will see a asp button, but if he choose option b he is not going to be the button

View 2 Replies

Data Controls :: How To Filter DropDownList Based On UserName

May 7, 2015

How do each company select customer orders by company username and customerid . The application will be used by many companies for sales,  but o don't know How each company can select their customer orders by customerid and company username.

View 1 Replies

DataSource Controls :: Retrieve Data From SQL Server Based On Login Username (session Data)

Oct 12, 2010

I'm trying to make a dropdown list with data available based on the users login name. Heres what I have as my SQL Query in the SQLDataSource:

SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')

So say if the login username is "User1" but the database client name is "User1 Steel" I want the dropdownlist to pull "User1 Steel" as the display and Client_ID as the value from the dropdown list.

View 1 Replies

AJAX :: Show Hide Image Control On Page Based On Database Value

Dec 14, 2013

Below is House_info table

id name behcode

1 Neda 1111
2 Jack 2222
3 Sara 3333

House_p table

id Product behcode

1 sofa 1111
2 iron 1111
3 scarf 2222

and below is SP

ALTER procedure [dbo].[storeinfo1]
@Behcode nvarchar(10)
as
begin
select behcode,Name
,(select Behcode from House_p where BehCode=@Behcode) behcodeP
from House_Info
where BehCode=@Behcode
end

I have image=>Productimage  in product.aspx page I want if in House_p table there be my users behcode it do Productimage.visible=true 

i.e

In House_info table exist user Sara with behcode=3333  her behcode  isn't in House_p table so I want in product.aspx page ProductImage.visible=true

How I can do it?

View 1 Replies

MVC :: How To Show ViewData In Specific ContentPlaceHolder In Specific MasterPage

Feb 1, 2010

This is my Controller Action which takes a Page entity from database and shows it in the Show.aspx view using the "Site.Master" master page:

[Code]....

This is the "Show" view rendering "Page.Title" in the "MainContent" content placeholder:

[Code]....

And this is the "Site.Master"

[Code]....

Using this approach i can show "Page.Title" in Show.aspx using any master page that has a "MainContent" placeholder, but my real goal is if i can when i choose the MasterPage for that particular Page to also see a list of available ContentPlaceHolders and when i choose one to then render "Page.Title" in that particular ContentPlaceHolder.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved