Create a user profile page dynamically - httphandler? profile provider? - dynamic-data

I want to dynamically create a user profile page with user info displayed (name, address, uploaded content, etc.). I've looked at many tutorials online related to this, but am not sure which way is best. I am using ASP.NET Membership provider for user data. Should I use HTTPHandler and create the ashx file? or just use the Request.QueryString method directly in my code behind? And I'm not sure where ASP.NET Profile provider fits into all this. Thanks in advance!

I am using Forms Authentication in my site. As an example, to set the Welcome to the site label, i have
this.lblUserName.Text = "Welcome " + HttpContext.Current.User.Identity.Name:
If you added more personal information to the Userdata property of the forms ticket, you could show that personalized information similarly.
Hope this helps.

Related

Asp.net /sharepoint server 2010 integration

We have a asp.net application. Would like to integrate with sharepoint issue tracking application we are building.
We would like customer to login in asp.net application and when a link is clicked, it should pass login and other info (like customer id) and display a new issue list so that they can enter rest of information and submit.
Any ideas how to accomplish this?
Thanks
They have to share the membership provider , using the FBA within SP2010.
Here is a Walkthrough http://blog.sharedove.com/adisjugo/index.php/2011/01/05/writing-a-custom-membership-provider-and-using-it-for-fba-forms-based-authentication-in-sharepoint-2010-from-the-scratch/
Then make a custom Form for the Issue reading the Session varialbles to fill in the Form.

ASP.NET Profile Page Authentication

I am new to .NET framework and I want to create a profile page for each user to edit their own page. How do I make this edit page only available to the specific user? Is there a way to do this without me manually going into the code every time I have a new user sign up?
I'd take a look at ASP .NET Membership. Then you can lookup the user "profile" based on their Id to load the appropriate information.
You start by ensuring that the page is only visible to authenticated users. You do this by setting the appropriate settings in web.config for the corresponding folder or file.
Once you've done that, this page should simply load details for the current user. All users would see the same page, but it's content would be populated by your code only for this current user.
There would therefore be no way for one user to display the contents for another user. The ID of the user being viewed/edited should definitely not be a query argument or anything like that.

Using Sessions in an ASP.NET 4.0 Log-In Control

I'm currently developing a website using Visual Studio 2010. As you all might know, creating a new website here automatically adds an Account folder which contains webpages like Login.aspx, etc. I am implementing this Login.aspx which contains the ASP.NET Login control. It's now functioning the way it should but I have a few concerns.
Before, I used to create my own UI for the log-in so managing sessions is not a problem to me. But since i'm currently using the Login.aspx which has a CS file almost empty, i don't have an idea where I can start implementing my session. Meaning to say, I don't know how to check programatically if the user has been successfully logged in so I can start implementing my session.
I would very much appreciate any pointer regarding this matter.
Thanks in advance. :)
You could subscribe for the Authenticate event and perform some custom authentication logic. Also you may take a look at the following article.
There are events associate with ASP.NET Login Control that you can use to create session like OnLoggingIn. Moreover you can find more about user validation from here Validating User Credentials Against the Membership

asp.net mvc account model

I want to know is it possible to extend membership model for users in asp.net mvc3.
I want to add little more info about user like, City, State, or web site and picture url.
So i update my register model in default account models register user goes fine but i don't know does it store other info, i only can find username and email.
Does anybody know how to extend this model, made changes in default tables?
I am using default account controller and models with asp.net mvc3.
If you think about it, the information you want to add, is not really Membership information. I'd recommend you use a profile provider instead.

Determine if user can access database generated page?

I have Membership, Profile and Role providers setup for my .NET MVC website. I would like to say: this Role has access to that Page.
How do I 'inject' this code to the RoleProvider? Or do I have to override it somehow? Any leads?
(Roles are stored in the default ASP.NET SqlRoleProvider, Pages are stored in a seperate SQL database).
Why would you inject this into the role provider? Why not just decorate the ActionResult [Authorise(Roles="myrole")]?
I understand that your pages are in the database but the action result still needs to call the view right?
I guess you could write you're own custom attribute which can check and either grant access or deny it.
I don't think the role provider is the right place for determining whether a page can be displayed or not.
Take a look at using sitemaps under asp.net. It is VERY easy to manage and to extend.
I have even used them as the datasource for a menu system.
Once in your page, you can do something like:
User.IsInRole("RoleName")

Resources