.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Facebook like Profile URL with HttpModule

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I am trying to make URLs for users profile pages like Facebooks e.g. http://site.com/username. I had a code snippett from a book for how to do this but when it runs it says its processing a request that will never finish. Im new with HttpModules/handlers but Ive looked over like 100 pages trying to figure this out. My code is below. Any help figuring this out would be greatly appreciated..

public class URLRouter : IHttpModule
/// <summary>
/// You will need to configure this module in the web.config file of your
/// web and register it with IIS before being able to use it. For more information
/// see the following link: http://go.microsoft.com/?linkid=8101007
/// </summary>
#region IHttpModule Members
private IUserRepository _userRepository;

public URLRouter()
_userRepository = ObjectFactory.GetInstance<IUserRepository>();

public void Dispose()
//clean-up code here.

public void Init(HttpApplication context)
context.PostResolveRequestCache += (new EventHandler(this.Application_OnAfterProcess));

View Complete Post

More Related Resource Links

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Configuring Profile Image Export in SharePoint 2010

It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Profile not being save after redirect.



I am trying to save values into a Profile on Page1, then redirect to Page2 and access those values.  However, after the page redirects the profile values are blank as if they were never saved.   When stepping through the code I can see that they are being save on Page 1.

I suppose I could use session variables to store the information but I don't understand why saving the profile doesn't work.

private void PayWithPayPal()
        ProfileCommon profile = this.Profile;

        if (Global.CurrentUserName.Length > 0)
            profile = this.Profile.GetProfile(Global.CurrentUserName);
        profile.FirstName = uxFirstNameShipping.Text;
        profile.LastName = uxLastNameBilling.Text;
        profile.ShippingAddress.AddressLineOne = uxAddressLineOneShipping.Text;
        profile.ShippingAddress.AddressLineTwo = uxAddressLineTwoShipping.Text;
        profile.ShippingAddress.City = uxCityShipping.Text;
        profile.ShippingAddress.State = uxStateShipping.Text;
        profile.ShippingAddress.ZipCode = uxPostalCodeShipping.Text;

        Response.Redirect("~/expresspayment.aspx", false);

protected void Page_Load(object sender, EventArgs e)
        ProfileCommon p

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

Profile Provider in Asp.Net MVC

The article Profile Provider in Asp.Net MVC was added by krokonoster on Wednesday, June 02, 2010.

Finding very little information on how to implement Profiles in Asp.Net MVC, I thought I'd share my solution to implement this. For demonstration purposes, let's assume you want to store a user's First and Last Name only. Firstly I created

Installing a httpModule on IIS6



I am trying to install a httpModule on an IIS 6 web server. I have the same module working on an IIS 7 test box, but we still have a couple of IIS 6 boxes to support.

The module is:

  • c# .NET 2.0
  • registered in the GAC
  • added to the system level web.config (as we want this for all applications on the box). I followed the instructions from http://msdn.microsoft.com/en-us/library/ms227673.aspx. I tried it with both short name (as in the web page) and the full strong name (like the other entries in the <httpModules> section.

So, I am at a loss as it does not appear to even being called and any suggestions would be appreciated.

Thanks in advance,


Facebook Connect


Does anybody have links to relevant articles on how Facebook Connect integrates with the Membership provider?

I'd like to make a .net site where you can login through the membership provider, or the Facebook Connect system.  But the big question is, how does your asp.net application know when the Facebook authentication has been successful.  Without manually entering a username and password, is there a function to authenticate users and draw the profile info from Facebook's data?

It seems like a good system, but the documentation is sparse.

how to develope a post and comments template like facebook



i want to develope desgin  like facebook .

where i have posts and comments will pick from the database that i inserted earlier.

what will be the best possible way to do in the same template.


Extended MySite: Profile picture uploading to the wrong zone.

I'm experiencing a problem where uploading a profile picture, in a MySite, uploads it to the wrong zone.

What I've done is created one web application and configured SSP to use that same one. As a result, the MySite host location is in that same web application:

Default Zone:
http://my.domain.com  <-- default SharePoint site.
http://my.domain.com/personal <-- MySite host

I then extended that web application to enable FBA & anonymous access:

Internet Zone:
http://extended.domain.com <-- extended default SharePoint site.

Now I"m able to navigate to a user's MySite using the extended URL (http://extended.domain.com/personal)...but when I upload a new profile picture in my MySite... it prompts me for new credentials because it's trying to upload to the Default zone (http://my.domain.com).

I found the following thread that talks about this...but there wasn't any resolution:

What is the best practices when configuring a MySite in an extended web application? How can I fix the situation I'm encountering above?

P.S. I tried to change the MySite Host location (via SSP in the Central Administration)

Profile Pictures not displayed in Discussion Board in SharePoint 2007

Picture Placeholders are displayed instead of Profile Images in Discussion boards in MOSS 2007 but when you click on the user, their pictures appeared in MySites, also with Search People. How to fix this?!

Not able to edit user profile in share point


Hi ,

I am new to share point, and not able to edit user profile data in sharepoint2007. I am getting an error "can't edit the property try with user profile services".

I have ran full crawl still getting the same problem. Also let me know how I can fetch data from Active Directory to share point 2007.



Update Profile Database from text file using BDC



I have a requirement to import the profile properties from a text file in sFTP to update the MOSS Profile Database. The objective is to create a single repository for the Staff Directory in MOSS.

Can I use BDC to connect and update the Profile database?

What is the alternate approach?


Programmatically Changing the Profile Provider at Runtime


Dear All

I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.

This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:

Dim RolePV As RoleProvider = Roles.Providers(GetSettingFromFile("Provider"))

However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.

Please can you help me to understand how I access the profile property called ScreenSize by dynamically setting the profile provider first?

I'd be very grateful for any help or advice.

Many thanks



Where can I find the code of the Twitter or Facebook or WebGrid helpers?


Just in general, where can I find the code to take a look at and learn from them? Or at least look at the functions available to me as I do get the feeling that the insufficient documentation at the moment reveals all.

Add new fields Profile database


I have new "Fields" which is not in the AD of my users. I want to add these new "Fields/ Columns" in the Profile database?

The objective is to create custom page in MOSS to facilitate the HR to update these new fields for the users.

How to achieve this?


Iterate through profile information


I have a site I'm working on where the values being stored in user profiles can change so I need to iterate through all available profile options and display them (say in a label or gridview for instance).

Here is an example of a web.config I threw together

<profile enabled="true">
        <group name="Demographics">
        <add name="FirstName" type="String"/>
        <add name="LastName" type="String"/>
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend