MVC :: Customising The User Table To Add Functionality?

Aug 11, 2010

I wanted to add a field called "Account" to the User table (default Membership user system provided in ASP.NET) and this field would store a certain value, perhaps the shortname of a country (ie. "AU" or "NZ").I could then use this attribute to decide which rows of a particular database table to display to that user (based on the "Account" value in the displayed table linked with the "Account" value in the User table).

How can I modify that table without causing damage? Or is there a better way to do this?

View 1 Replies


Similar Messages:

User Controls :: How To Check If User In User Account Table Is In Another Table Called UserFollow

Apr 27, 2016

I want to check if a user in User table is found either in UserName Column or in FriendUserName Column in UserFollow table and if yes display lable found, But if no display lable notfound. This code will be excuted onse a user logs in the connection code

protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserName"] != null && Session["UserName"].ToString() != string.Empty)
{
string userName = Session["UserName"].ToString();
if (!this.IsPostBack)

[code]...

View 1 Replies

Web Forms :: Import Functionality In Multiple Table Using 1 Excel Sheet

Feb 2, 2011

I want to get code for how to insert records into multiple table of database from one excel sheet.

View 3 Replies

C# - Basic "add User / Edit User" Forms Authentication Functionality In MVC

Jan 4, 2011

I want to use forms authentication on my ASP.NET MVC site. All I need is a place for users to login, a page to add a user, and a page to edit a user. I'm using all the default ASP.NET forms authentication tables for SQL Server (aspnet_Profile, aspnet_Roles, aspnet_Users, etc.). The only difference is that I've added an Employees table to my database, which contains a FK to aspnet_Users to create a one-to-one relationship. The Employees table contains columns for FirstName, LastName, StartDate, etc. It's a way for me to keep additional information for the users.

I'm having trouble finding any sort of tutorial that would help me build a basic page in MVC, everything I find is for WebForms. For my page to add a user, I'd like there to be fields for the Employees table. I don't know if I can modify the CreateUserWizard to add those fields, or if I'd be better off just creating my own custom page.

View 2 Replies

Web Forms :: Can One Web User Control Gives Two Different Functionality On Two Different Web Pages

Feb 4, 2011

can one web user control gives two different functionality on two different web pages,suppose i use web user control on web form 1 and also web form 2 , but i want some more work from this control on web form1 but this more work not affect on web form 2. for example: button click event of web user control gives me Good Morning message on screen, when i use this control on web form 1 and web form 2 ,it will give me Good morning message on screen,when i click this button, But i want that ,this control give me Good Morning message and some other messages like good after noon on web form 1 only, one control but different functionalty on two different pages

View 2 Replies

MVC :: Add The Functionality Of Adding Profile Images For Each User?

Dec 27, 2010

i want to add the functionality of adding profile images for each user, which i found are based on just uploading images to the web application but without linking these images to the login user.

View 3 Replies

Security :: Signin As A Different User Functionality In Web App With Windows Authentication

Apr 19, 2010

We have an ASP.NET Web App, where we want to provide a link 'Sign in as a different user' on a page. Authentication mode is Windows. Went through a couple of articles (like setting the statuscode =401). We want to authenticate the user, and then redirect him to a specific page (say 'ReviewTask.aspx');

View 2 Replies

Web Forms :: How To Add Some Client Side Functionality To A User Control

Feb 28, 2011

I am trying to add some client side functionality to a user control that I have written.

A really simplified version of my scenario is as follows:

I have a control called MyControl. This has a javascript method called doSomething that simply shows the current date and time in an alert box.I add an instance of MyControl to a page called WebForm1. I want to be able to call myControl1.doSomething when a regular (non ASP.NET) button on WebForm1 is pressed.

I'm sure this is really simple but I can't for the life of me figure out what I need to do make doSomething available.

View 7 Replies

Security :: Membership User Has To Logout - Login Again In Order To View New Role Assigned Functionality

Jul 15, 2010

i currently develop an asp.net mvc 2 web app using asp.net membership and role management for authenticating and authorizing my users. I get complaints though that when adding a role to some user, he is not able to see new role assigned functionality, unless he re-enters (logout and login again) the application.

View 2 Replies

Decrypting Password / Copy User's Data From Old Table To New Table?

Apr 2, 2010

I have an asp.net database which has users table. In this table password is saved as sncrypted. Now, I am creating my own users table. I want to copy user's data from my old table t this table. I can to decrypt old users table password. Which encryption technique is used by default in aspnet database for passwords.

View 2 Replies

Security :: Userid Of Newly Created User / To Store Additional Details Of The User In Another Database Table

Nov 10, 2010

Our application lets the administrator create new users. Since the administrator is logged in, I have set Logincreateduser = false so that the administrator is not logged out even after creating the new user.

The problem is :I need the userid of the newly created user to store additional details of the user in another database table. I see that i can get the username using Createuserwizard1.username; but how do I get the userID?

View 2 Replies

MVC :: Page.user Info - Register User Logs Logs Table - Use Userid

Dec 28, 2010

i use formsauthentication for login. but i wanna register user logs logs table. i can access username page.user.identity.name, but how can use userid?

View 4 Replies

Changing User Name In A Table?

Mar 8, 2010

I am using profiles to store extra information about users. The thing that I want is that I am changing user name. But on the other side I have photo album gallery where I have stored the User name (Creator of album). These two tables (aspnet_Profiles and PhotoAlbum) are in different databases.

I have tried the following code while changing the user name

Private con As New SqlConnection(ConfigurationManager.ConnectionStrings("Photo").ConnectionString)
Dim updateSql As String = "UPDATE PhotoAlbum SET UserName = @UserName WHERE UserName = " & userName.Text
con.Open()
Dim myCommand As New SqlCommand(updateSql, con)
myCommand.Parameters.AddWithValue("@UserName", newUsername)
myCommand.ExecuteNonQuery()
con.Close()

Here newUserName is the new user name field and UserName is the previous name stored in PhotoAlbum table.

But it does not seems to work.On debugging it reports Invalid Column Name "userName"

View 4 Replies

Security :: Referencing The Membership User Table?

Oct 13, 2010

When creating a foreign key to the membership user table, is it better to refer to the user_id column or is it ok to use the username column? I assume that the Membership spec enforces uniqueness in the username since there is a method Membership.GetUser(username) that returns one user. Using the id is a bit awkward in code because I have to end up casting all over the place like (int)user.ProviderUserKey. The username would give more information quickly when viewing raw data as well. Just wondering if someone knows a reason why I shouldn't use it as the foreign key.

View 1 Replies

How To Retrieve User Data From Aspnet_profile Table

Jun 26, 2010

I am retrieving user data from aspnet_user table from aspnetdb database but I also want to retrieve data (such as first name, last name, email, address etc) from aspnet_profile table. I am using dropdownlist which retrieves user names from the aspnet_user table.

retrieve user data from aspnet_profile instead?

My code is as followed:

[Code]....

[Code]....

View 1 Replies

Which Control To Present Table For User To Choose From

Nov 10, 2010

I want to put up a table with a couple columns, and have the user select a row. This will all be from code; not through a DataConnection. GridView seems like it wants to deal with bound controls. What control should I use? ListView doesn't do columns. A table doesn't seem to allow selection. Specifically, what I'm doing is letting the user find a person in active directory. They'll enter the name, and I'm going to present a list of the Active Directory matched results that they can choose from. Is there already some built in control or package that will do this?

View 1 Replies

Security :: Login Using Database User Table

May 6, 2010

I am dtrugling with the log in of .net. I have studied a wrox asp.net 2 book and it says add

<authentication mode="Forms">
<forms name="Wrox" loginUrl="Login.aspx" path ="/" />
</authentication>
<authorization>
<deny users ="*" />
</authorization>

to the web.config file. This automaticaly sends me to Login.aspx. The problem I have is I have added this line to the code behind in Login.aspx

protected void submit1_Click(object sender, EventArgs e)
{
FormsAuthentication.RedirectFromLoginPage(User.Text, false);
}

NOW this does not check the password but it should in THEARY send me to the page I was going to. It dosnt it stays on the login page.

View 2 Replies

MVC Use An Extra Table To Store User Profile?

Dec 27, 2010

ASP.NET MVC Can I use an extra table to store user profile? And how to do that?Something I've done here:I have a database table has userId name, email, password stuff.I want to use all the information in this table for user authentication, and also for user profile. How can I do that in Asp.net Mvc2 project

View 1 Replies

Security :: Duplicate User Entries In Aspnet_Users Table?

Oct 13, 2010

I'm using SqlMembershipProvider and SqlRoleProvider for user management.

Users are created by

Dim MCS As System.Web.Security.MembershipCreateStatus
Dim NewUser
As MembershipUser = Membership.CreateUser(TB_UserName.Text, TB_Pw.Text, TB_Email.Text, TB_SecQuestion.Text, TB_SecAnswer.Text,
False, MCS)
later, after email confirmation, I take the user into a specified role
Dim myUser As System.Web.Security.MembershipUser = Nothing
myUser = Membership.GetUser(New Guid(Request("RegID")))Catch
If myUser
IsNot
Nothing
Then
myUser.Comment += " approved "
Membership.UpdateUser(myUser)
Roles.AddUserToRole(myUser.UserName, "role")
End if

After this I have two entries with the same UserName in aspnet_Users table, but with different UserId's. One UserId is referenced in aspnet_Membership table and the other in the aspnet_UsersInRoles table.

View 2 Replies

C# - Adding Rows To A Table Based On User Input?

Jan 19, 2010

I have a TextBox entry field where the user will enter a integer value. And then there is a "Create" button, which when clicked upon must generate a Table with 2 columns :

"Name" and "Email" being the column headers.

I want each row to have a textbox in each of these columns.

All of this has to happen after the button is clicked. I have discovered that if you dynamically add a control in ASP.NET(I am using C#) then the controls are lost during postback. And I don't know how to prevent that from happening.

Can somebody give me some ideas regarding how to go about adding rows dynamically to a table (I tried using the asp.net Server side table control but ran into the "lost-during-postback" problem - can I try with something else like a gridview ? but afaik a GV will not work without data bound to it )

Point to note is that my table has textboxes for user entry and it is not for showing data ..rather it is for accepting data from the user which will be later used to persist details to the database.

View 1 Replies

How To Update A Table And Get The Updated Value For Further Use In A Multi User Web Environment

Nov 22, 2010

I am working with asp.net 2.0 and sql server 2005. so trying to describe it below:

THE SITUATION

I have a few tables to hold data for billing information. The first table has each dedicated to each location, and a serial number that can be incremented. The concept is to update this data based on location, every time there is a new bill, so may be location A has serial 25 since it is doing well but location B has serial 5.

THE PROBLEM

SO based on this requirement I need to update a table to get the latest serial for a particular location and then use that serial for other tables which will be holding the billing details. The second part is as regular as it can be, but generating a new number, and getting this value is my problem. Since this will be multi user system, so I want some robust solution. I do not know whether I can use a identity field for this purpose or not.

View 1 Replies

Security :: Adding Field To Membership User Table?

Jun 8, 2010

Is it possible to more fields in User table If yes, how to do that? share sample code. Do we we need to change any membership stored procedures?

View 3 Replies

Security :: How To Insert Records In Membership User Table

Feb 23, 2011

How to Insert Records in membership user table?

i m working on mvc 3.0 application and using bulting feature of membership for creating account and i have using ASPNET_REGSQL.EXE command than i have migrated table in our database but when i create any user in membership mvc user account but in database, records are not inserted of user ...

View 1 Replies

Access :: Stamp Current User In A Table After Upadate?

Aug 18, 2010

Users login to an MS Access database table called users with a password and the time logged in is also captured in the same table.If this user updates a record in another table called KTdata, I want that user's name stamped in this table.

View 1 Replies

Web Forms :: Check If Record Exists In Table And Prompt User

May 27, 2010

Using C#.NET and VWD 2008 Express

I'm looking for a hand with:

When inserting, i would like to check if the record exists in the table, then if it doesn't, insert it, else either redirecting to a different page, or showing a message box saying "Record already exists" ...

View 6 Replies







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