C# - Error Creating New User By Admin?

Jun 18, 2010

I am creating a web application using Form Authentication of Asp.Net with C# and back end Sql Server. Here in my application administrator login and creates new users. I am using the create user wizard under login controls. My problem is when the new user is created by Admin he is automatically logged out and logged in with new user credentials which he has just created.

View 2 Replies


Similar Messages:

VS 2010 - Redirect User When Error Detected On A Page And To Notify Admin

Nov 13, 2011

I have this code , to redirect user when an error is detect on a page, and to notify the admin

vb Code:
Protected Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Error
REPORT IF ERROR DETECTED Dim a As New errorhandler       
a.reporterror(Page.Title.ToString & " "
& Request.Url.Host.ToString, Server.GetLastError.ToString)
End Sub

then under another button I have this try and catch , i wud like to show the user there is an error on the date input format.

vb Code:
Try 
aaa = dateTextBox.Text.Split("/") 
bbb = aaa(2).Split(" ")
If (bbb.Length > 1) Then 
a = aaa(0) + "/" + aaa(1) + "/20" + bbb(0) + " " + bbb(1).Substring(0, 2) + ":" + bbb(1).Substring(2, 2)     

[Code] ....

But whenever an error is detect the user is redirected to another page (errorhandler).I was wondering if it's possible not to redirect the user if the error is of type InvalidCastException .

View 9 Replies

Creating 4 Websites With One Common Admin Panel

Jun 24, 2010

Creating 4 websites with one common admin panel

View 6 Replies

Creating 4 Website With Same Database And Admin Panel?

Jun 24, 2010

I am planning to develop around 4 product catalogue websites. The functionality of all the websites would be same. however the design, images and css would be different.

All the 4 websites will use the same admin panel, forums and database(MS Access) also.

How should I create such a system.

I dont understand what kind of folder structure should I create.

I would like to create following kind of folder structure.

(Root Folder)Admin Website ----> Website 1 (subfolder)

----> Website 2 (subfolder)
----> Website 3 (subfolder)
----> Website 4 (subfolder)

Root folder will have the database and all the common files.

Unfortunately, when I tried to create such structure, Dot Net Didnt allow me to create one website inside another

what kind of system should I use for maximum reusability.

I am a small time freelancer and cannot afford to build seperate websites for each of my client.

View 4 Replies

Creating (hiding / Showing) Admin Menu For Website?

Sep 16, 2010

I am currently developing a website for a friend of mine who is a dj. I have a login page, which works fine however i want to inplement a menu that only users with the Administrator role can view. I have done alot of research and i have found ways to stop a user from visiting a page, when they click on it it takes the to the login page. But i want to completely hide the menu from Non Admins.

View 4 Replies

Security :: Creating An Admin Area For Deleting Users?

Feb 11, 2010

Following one of the other tutorials I have figured out how to manage users [URL] but it does not mention how to delete them from the GridView. I have attached my Page's code plus my VB script. I have added a delete link into the GridView for preparation but all I would like is the VB script so that when the user clicks delete it deletes the user from the GridView and Databse. I hope I have made every really simple, anyway here it is:

ManageUsers.aspx

[Code]....

View 2 Replies

Security :: Creating An Admin Tool To Reset Password Without Question / Answer?

Oct 29, 2010

I'm dealing with a scenario where a legitimate user doesn't have a clue about his password, secret question or the answer. So, I was trying to create an admin tool that would help me in situations like these where the admin should be able to type in username and reset the password without having to know/enter answer to secret question. I understand that I need to make some changes to the web.config for this to work. I thought I made all the changes but my ResetPassword() requests are still not working.

Here's my web.config settings for the provider.

[Code]....

View 4 Replies

User Is In Role "admin" But (Authorize (Roles="admin")) Won't Authenticate

Mar 15, 2011

I found a great answer on SO describing how to set up custom user roles, and I've done the same in my project. So in my Login service I have:

public ActionResult Login() {
// password authentication stuff omitted here
var roles = GetRoles(user.Type); // returns a string e.g. "admin,user"
var authTicket = new FormsAuthenticationTicket(
1,
userName,
DateTime.Now,
DateTime.Now.AddMinutes(20), // expiry
false,
roles,
"/");
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
FormsAuthentication.Encrypt(authTicket));
Response.Cookies.Add(cookie);
return new XmlResult(xmlDoc); // don't worry so much about this - returns XML as ActionResult
}
And in Global.asax.cs, I have (copied verbatim from the other answer):
protected void Application_AuthenticateRequest(Object sender, EventArgs e) {
var authCookie = Context.Request.Cookies[FormsAuthentication.FormsCookieName];
if (authCookie != null) {
var authTicket = FormsAuthentication.Decrypt(authCookie.Value);
var roles = authTicket.UserData.Split(new Char[] { ',' });
var userPrincipal = new GenericPrincipal(new GenericIdentity(authTicket.Name), roles);
Context.User = userPrincipal;
}
}
Then, in my ServicesController class, I have:
[Authorize(Roles = "admin")]
//[Authorize]
public ActionResult DoAdminStuff() {
...
}

I login as a user with the "admin" role, and that works. Then I call /services/doadminstuff - and I get access denied, even though when I put a breakpoint in Global.asax.cs, I can see that my roles do include "admin". If I comment out the first Authorize attribute (with roles) and just use a plain vanilla Authorize, then I can access the service.

View 1 Replies

VS 2008 When Admin Register New User The Site Logs In As The User Who Was Just Created

Mar 4, 2010

This is what I have in the RegisterUser.aspx and yet when the admin registers a new user, then on clickiing the register button, the site logs in as the user who was just created.

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
Roles.AddUserToRole((sender as CreateUserWizard).UserName, "Department");
}

View 4 Replies

Admin Terminating A User Session?

Jul 12, 2010

In our project, we have a situation where the administrator needs to 'force log off' a particular user under certain conditions. In other words, the admin user needs to have the ability to kill any other user's session.Is this possible? By using the session properties, we can kill the current session (the current user's session) but is it possible (for the admin user) to kill some other user's session?

View 1 Replies

Sitemap Admin Seeing What A User Sees

Jan 21, 2010

I am currently trying to figure out how to best go about implementing an administration side for my application.I have a user site, where users can log in, customize their profile, submit information etc.I would like administration users to be able to log in and be able to choose from a list of users. From there, the administrator can submit information for the user just like the user can.

Website Start Page > RogerRabbit > Submit Information
Website Start Page > BillyBob > Customize Profile

So my question is:

How should my pages be laid out?How should the Web.sitemap file look? Is there a nice way of creating a sitemap (maybe in memory?)Would this method have to use session variables?

View 2 Replies

Security :: Difference Between Admin User And Others?

Dec 22, 2010

have table for users have a some attribute one of them admin attribute have a bit data type when the user is admin it is true and i have ligin page and control panal page i want throw login page check for the user to redirect him to control panal if the user is admin the control panal will be displayed with moreoptions any one how can i doing this with select statement

View 2 Replies

Security :: Checking To See If The User Is An Admin?

Mar 17, 2010

i am currently checking to see if the logged in person is an admin, by putting a check in the page_load function. (same thing to see if the person is logged in at all)

is there a better way to do this? or should i just go ahead and put my check on every single page?

View 1 Replies

MVC :: Using DataAnnotations To Validate Creation Of A New Admin User?

Aug 10, 2010

I'm using DataAnnotations to validate creation of a new Admin user. However on EDIT page I want to have password and confirm password fields blank. This way i know that password has not changed. However whenever I EDIT a user I get ModelState.IsValid = false because password and confirm password are blank even though I set these in my controller. how would i fix this so that on EDIT screen I can omit "Required" validation?

Controller:

[code].....

View 4 Replies

If Admin Block User Then Session Should Be Expired

Jul 12, 2010

Is there anyway to implement this.If admin block a user then session of that current user should be expired in ASP.NET

View 1 Replies

Security :: See All Online User In Admin Panel?

Aug 4, 2010

I am using SQL membership authentication and SQL Database for my ASP.NET Website and its using for my Organization (has multiple Branches in different cities).How I can get all user list which are recently online/Login in my system (WebSite) in my Admin Panel?

View 4 Replies

Security :: Two Roles (admin, User) And Two Folders?

Nov 15, 2010

In my project I have one folder called Administration (contains pages created for administrating the public part of the page) and in root I have public pages. What I want to do is to prevent anyone beside administrator to enter the Administration part and to make the Administration/Login.aspx default page for entering Administration part. This part makes me confused. I tried to create the access rules, but that wasn't the option because I upload the images to the Administration/Upload folder so if I deny the users the images on the public part can't be accessed.

The second problem I don't know how to solve is public part of the page where I want to allow commenting only to logged in users (users only, not the admin). How to check if user is logged in and authetificated and how to enable the commenting part of the form to him (textbox and submit button).

View 6 Replies

Security :: Redirecting User To Admin Page With Username

Mar 4, 2010

I have a directory structure root->admin-> admin operations admin page inherited from a ase page with principla security.demand role = "Admins" i am usinf forms authantication mode. i have also put a web.config file in admin folder, restricting other users. it is working normaly with siteroot/admin. I want to setup a mechanism to admin like siteroot/username/admin I can redirect to page admin but it gives security error, it should redirect to login page instead of if user did not sign in.

View 5 Replies

Session - Memberships Force User Offline (as Admin)?

Feb 5, 2011

I am looking for a way to distroy the ASP.net membership session for a specific user. The reason I am doing this is as an admin I want to delete a user. This works fine, but if the user already has an active session, he is still marked as "online" until this session dies (I verify each time by using Current.User.Identity.IsAuthenticated). How do I go about killing a session based on the user it's authorized as. This way when I do Memberships.DeleteUser(username) I can also do Sessions.KillByUser(username)[URL]

View 2 Replies

Installation :: IIS Configuration - Vwd To Work As An Admin(windows 7) - Get The Error ?

Mar 26, 2010

i finally got vwd to work as an admin(windows 7) but now i get the error screen below:

Where can i find these, i went to add/remove programs, windows features, and there is only one box checked for ii6, no other options, no "Windows Authentication". Can I get these items somewhere else? I didn't see them on iis web site either.

View 3 Replies

Permission On Admin Folder, Only For Role=admin?

Jun 13, 2010

I have an Admin folder which contains 4-5 aspx pages. I want to that only user with role="admin" can view those files. What settings i need in web.config?

View 1 Replies

Dynamic Data And Real World User Admin Application?

Sep 3, 2010

develop a user admin application.My schema looks like the following:See full size As you can see I've got my own version of the user table and profile tables to store my data with a one-to-one mapping with aspnet membership tables.I'm interested in using ASP.NET dynamics to speed up the proccess of creating an admin system.

I would like to create a customised listing with a search and a data grid listing with just basic details such as name and state information, date registered and then when you click to edit your presented with the domain representation of the data and not the exact undelying data.Has anyone any experiece in doing this or building a real work application with Dynamic data?

View 1 Replies

Security :: How To Create A User Login Control Without The Use Of Web Admin Tool

Apr 17, 2010

I'm looking for a way to create a login control without the use of web admin tool

Here are my system requirements

Windows 7 Visual Studio 2008 Professional Edition Microsoft SQL Server 2005 Express Edition ESET Anti-virus but SQL and Studio files excluded from being scanned. I have got a database. I've created the front end of the user login control manually not using the toolbox. Basically what I need is that once a user has registered. He then logs in. when he enters his username and password how do I code it so the database realises it's him/her and takes them to their LOGGED IN user

View 7 Replies

Need Certain Algorithem/formula Or Code Where Admin Assign Userid/password To User?

Oct 26, 2010

i need certain algorithem/formula or code where admin assign userid/password to user ,means multiple user get registered site but user id and password are assign by admin after registered . did not any thing on google yet !!

View 3 Replies

Security :: Create Admin Folder And Pages To Add User ,content ,authentication

Jan 13, 2011

i need some lessons in how to create admin folder and pages to add user ,content ,authentication, etc

View 2 Replies







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